Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to switch between multiple AWS accounts with Zappa

I am experimenting with how to deploy lambdas into different AWS accounts in continuous delivery environment. At the moment I am stuck with that. Can you please give me a clue about this? As an example with AWS CLI we could define which profile we need to use.

Ex: aws s3 ls --profile account2

In the AWS config file, we define the profile as follows.

[default]

aws_access_key_id = XXXXXXXXXXXXXXXXXX

aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

[account2]

aws_access_key_id = XXXXXXXXXXXXXXXXXX

aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Can we use the same approach with zappa deployments?

Highly appreciate any clue to solve this issue.

like image 242
Hareendra Chamara Philips Avatar asked Oct 22 '25 16:10

Hareendra Chamara Philips


1 Answers

There is an options to nominate the profile name, did you try it?

        "profile_name": "your-profile-name", // AWS profile credentials to use. Default 'default'. Removing this setting will use the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables instead.

https://github.com/Miserlou/Zappa/blob/b12bc67aac00b1302a7f9b18444a51f21deac46a/README.md

like image 69
BMW Avatar answered Oct 26 '25 05:10

BMW