Reputation: 11265
I'm try to describe my situation:
Have multiple AWS account, credentials is located under ~/.aws/credential
To swich to other account I'm typing:
eb init -i --profile name
Now to deploy code to accounts I must every time switch to other acc. How I can organize .ebextensions
to have possibility to deploy to 10 AWS acc without switching between profiles ?
Upvotes: 0
Views: 2558
Reputation: 1349
You don't need to do eb init
every time. You can deploy with arguments, eb deploy --profile profile_name
.
If you setup your .elasticbeanstalk/config file something like this you can have different profiles and branches for different environments without using arguments.
branch-defaults:
develop:
environment: env-develop
profile: eb-profile
master:
environment: env-master
profile: eb-profile2
global:
application_name: env_name
default_ec2_keyname: key_name
default_platform: Python 2.7
default_region: ap-southeast-1
sc: git
I haven't tried this, but if you call eb deploy environment_name --profile eb-profile3
that is linked to somewhere else it should deploy there with your branch and global specific settings (profile overriden).
eb deploy <environment name>
overrides the environment name.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-deploy.html
I have only read this briefly, but maybe this can help you as well. http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebcli-compose.html
Upvotes: 5