Reputation: 345
I created a PHP application using the AWS GUI. Now I want to use git to deploy the code. While running eb init it is asking me settings which look like it is setting a new application and environment but I don't need that as I have already created them through the GUI.
How do I use eb deploy without going through eb init or how do I get eb init to directly pick up the settings viz application and environment name that I created using AWS GUI?
Upvotes: 0
Views: 77
Reputation: 6164
Your account could have multiple applications with multiple environments across multiple regions. It's not possible for the cli or eb to know which app, environment or region to use without you telling it at least one time. For this reason, if you intend to use the cli, you must run eb init
in the root directory of your application to tell EB what region, application, and environment you want EB to deploy your application to at least one time. Running eb init
creates a couple directories and a config file that eb uses to know exactly where to deploy your code.
It's worth noting that you only have to initialize your application with eb init
one time. You'll then be able to use all the eb commands like eb deploy
and eb status
from then onwards. You should note that when you run eb init
EB will attempt to deploy your application based on the new settings.
If you wanted to avoid manual deployments via eb deploy
you can setup a CodePipeline which will deploy for you based on the rules you set. You create a pipeline in the GUI and give CP all the same info that you would give EB in eb init
, except you'd be doing it via the CP GUI. You'll also give CodePipeline the source info, which GitHub repo and branch or S3 bucket to use, and CodePipeline handles executing deployments for you. When you tell CodePipeline to use the master branch of a repo, CP will monitor that branch of that repo for changes. When CP detects a change it will grab the code from the repo, build the package, and deploy it to your environment using the ElasticBeanstalk settings you specified in the GUI.
Upvotes: 1