Bitbucket pipeline AWS authentication with Repository variables

Arun Kumar D December 16, 2024

Hello Team,

 

I feel that "AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID" 

mentioned in the bitbucket pipeline is a little disturbing. I accept that if the same pipeline is used for deploying to multiple accounts, I can have that or if we are using pipes we can have that. But if this is going to be deployed into only one account then , Can this Access key secret key & default aws location be directly read from the repository variables  ?

Some years ago, I did that to some repo, but now I am inable to find that document in bitbucket confluence.

Can Some one help me with this or route me to that document also.

&& A help on the "Deployment" in the repo settings can also be helpful, because if I use the same into different env, I can use deployment variable in the bb pipeline.

Thanks

Arun Kumar D

 

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 17, 2024

Hello @Arun Kumar D ,

thanks for reaching out to the Community!

Yes, you can store your AWS Access Key ID, Secret Access Key, and other sensitive information as workspace/repository or deployment variables in Bitbucket Pipelines.

This way, you avoid hardcoding sensitive information directly in your bitbucket-pipelines.yml file.

The AWS commands will then use the configured environment variables when authentication to the AWS resources you are deploying to. For further details on how the variables can be configured and the precedence on how AWS cli looks for auth information, the following article might be helpful:

Let us know in case you have any questions.

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events