Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,259
Community Members
 
Community Events
184
Community Groups

Bitbucket Pipe for aws-cli v2 with OIDC

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.

1 answer

1 accepted

0 votes
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 05, 2023

@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

Like Igor Stoyanov likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events