Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying to separate accounts with aws cli

I have two aws accounts : production and staging. I'm using aws-cli v3 to deploy via GIT to my production environment using eb deploy

I want to be able to deploy to my staging environment regularly from my develop branch and when it comes to deploying a release I want to be able to deploy from my newly created release branch to my production environment.

I already have my ~/.aws/config file with my two account key sets (staging and production), and would like to be able to do something like:

eb deploy --profile staging

and

eb deploy --profile production

Is it necessary to have the two environments under the same account and use eb use production-env and eb use staging-env?

like image 679
Mark Kenny Avatar asked Mar 24 '16 16:03

Mark Kenny


People also ask

How do I use multiple AWS accounts?

You can use the AWS Organizations console, SDK, or AWS CLI to create an organization, and then add accounts, enable features, and turn on service access to other AWS services so they can operate across your organization. There is no cost to use AWS Organizations.

Which AWS service allows you to link multiple accounts together?

AWS App Mesh is a service mesh that provides application-level networking to make it easy for your services to communicate with each other across multiple types of compute infrastructure, even through cross-account boundaries.

How do I transfer an instance from one AWS account to another?

It's not possible to transfer existing instances or AMIs between AWS accounts. Instead, you can manually migrate an EC2 image from one AWS account to another.


1 Answers

A similar question has already been answered here

Also it does look like the eb command does support profiles

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-cmd-commands.html http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-cmd-commands.html#eb3-cmd-options

like image 171
strongjz Avatar answered Oct 17 '22 07:10

strongjz