using bitbucket-pipelines deploy same branch to multiple environments

923 views Asked by At

I have three environments is AWS dev/uat/prod, and the same branch(develop) I wanted to develop in all three respective environments using bitbucket-pipelines. As I know we need AWS AWS_ACCESS_KEY_ID to do so.

My question is: how to provide AWS AWS_ACCESS_KEY_ID for all the three environments dynamically?, I am able to deploy at time on one environment as of now.

Thanks for help in advanced

1

There are 1 answers

0
Michal On BEST ANSWER

There's a number of client libraries that allow you to parametrize AWS credentials without having to store them in the environment-specific config files. You didn't specify what AWS service you want to use, but here's and example for S3: s3_website

Their config file looks like this; you can configure multiple sets of variables.

s3_id: <%= ENV['S3_ID'] %>
s3_secret: <%= ENV['S3_SECRET'] %>

If this doesn't work for you, write a shell/python script around AWS CLI and pull the environment-specific variables into AWS config file yourself. Manage that script as part of your source code or a docker image.