I managed to get a rails app running throw Elastic Beanstalk using the EB CLI and instructions outlined here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-reference-get-started.html
I then set up a second application going through the "eb init" process a second time and using a different application name. How do I now switch between the two applications using the command line before doing "git aws.push"? Can I switch between them while keeping both applications live?
Bonus question: If I have two different AWS accounts and I have the access key/secret for both accounts, how do I switch between applications on different AWS accounts? I assume the same process of "switching accounts" is the same process you'd go through if you were to say set up git and eb on a second development computer and try to link up the second computer's local git repo with the live eb instance. Is this correct?
When you run eb init
, it creates a folder in your current directory called .elasticbeanstalk
. In it there will be a config
file which will have all of the info that you need for your current environment/application. It also has a value called AwsCredentialFile
which points to a file that contains your Access Key ID as well as Secret Key.
Therefore if you want to switch between applications, you can just have multiple directories where you have ran eb init
in each one and change the files accordingly.
When you configure an elastic beanstalk application using the cli, a file called config.yml is generated inside the .elasticbeanstalk directory. This file basically contains all the info about your elastic beanstalk application.
To change the application your project is linked to you can simply change the value of the application_name
in config.yml.
Run eb status
to verify if the application switch was successful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With