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

How can i execute aws sts assume-role --role-arn command from bitbucket pipeline?.

manish February 6, 2022

i am trying to execute below command from bitbucket pipeline. its throwing error to execute aws configure command.

I am looking to read AWS_ACCESS_KEY and AWS_SECRET_ACCESS_KEY from assume role .

The below command working file in mine local command prompt.

- CRED =$(AWS STS assume-role --ROLE-ARN ARN:AWS:IAM::xxxx:role/assume-role --role-session-name "RoleSession1" --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' --output text)

- export AWS_ACCESS_KEY_ID=${CRED[1]}
- export AWS_SECRET_ACCESS_KEY=${CRED[2]}
- export AWS_SESSION_TOKEN=${CRED[3]}

Below error in pipeline while executing above commands-

How can i execute above commands from bitbucket pipeline.

1 answer

0 votes
Norbert C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 13, 2022

Hi Manish,

Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you! Welcome to the Atlassian Community!

You mentioned that: "Below error in pipeline while executing above commands"

Can you please share with us, what's the error you receive in Pipelines while you execute the command? That'll help us troubleshooting your issue.

We're looking forward to hear from you.

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events