You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi All
Does there exist a somewhat generic Bitbucket Pipe that wraps the AWS CLI v2 command and includes the OIDC authentication options?
We've used some of the other pre-baked AWS Pipes such as "atlassian/aws-s3-deploy" which have the OIDC authentication stuff baked in and works quite nicely.
However when other AWS CLI commands are needed in automation, we've had to create some custom script to handle the OIDC_TOKEN and call sts assume-role-with-web-identity to get authenticated and then go ahead and run the desired aws cli command.
@James Pinkster hi.
Does there exist a somewhat generic Bitbucket Pipe that wraps the AWS CLI v2 command and includes the OIDC authentication options? -- I think the answer is no.
Pipes are the small wrappers, that's allow you to automate some common works, but not the full support like boto3 package for aws cli.
Full list of aws pipes you could find here: Bitbucket AWS pipes .
Also maybe this article will help you.
Here amazon/aws-cli docker image is used.
image: amazon/aws-cli
pipelines:
default:
- step:
oidc: true
script:
- export AWS_REGION=us-west-2
- export AWS_ROLE_ARN=arn:aws:iam::XXXXXXXXXXXX:role/oidc-demo
- export AWS_WEB_IDENTITY_TOKEN_FILE=$(pwd)/web-identity-token
- echo $BITBUCKET_STEP_OIDC_TOKEN > $(pwd)/web-identity-token
- aws s3 cp s3://bucket/XXXXXX ./XXXXXXX
Regards, Igor
The snippet demonstrating the use of the "amazon/aws-cli" image with the AWS_WEB_IDENTITY_TOKEN_FILE environment variable is what I was looking for. I must have missed this when I originally read the docs.
Thanks, James
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.