Can not set multiple environments (dev\stage\production) with elastic beanstalk

+5 votes

I need to do the following: Change the environment variables according to the published env. Configure the Kron jobs according to the dev. I would like to run a command line of just 1 line "eb deploy dev" or something like that

Mar 27, 2018 in DevOps on Cloud by shubham
• 6,890 points
266 views

2 answers to this question.

+2 votes
Best answer

This is how you do this in one command line.

Create your own folder with all the files for all environments. In .ebextensions folder, set empty configuration files for eb. npm runs a script called "deploy.js" with the specified env prompt. The script will do the following

  • copy the requested env data to the empty files according to the env
  • git stash the changes of .ebextensions folder (eb deploys using git)
  • eb use env
  • eb deploy

So now you can tun npm run deploy:dev and everything runs

hope this helps

answered Mar 27, 2018 by ajs3033
• 7,280 points

selected Oct 12, 2018 by Omkar
0 votes

To use the Compose Environments API, first run eb init from the project folder, specifying each component by the name of the folder that contains it with the --modules option, configure each component, and then create the .elasticbeanstalkdirectory in each component folder. 

For detailed explanantion have a look at the this blog.

answered Oct 12, 2018 by Hannah
• 15,340 points

Related Questions In DevOps on Cloud

0 votes
1 answer
+2 votes
3 answers

can't make nginx try_files to work with default_index.html

Here's another convenient use of try_files, as ...READ MORE

answered Oct 18, 2018 in DevOps on Cloud by Hannah
• 15,340 points
342 views
0 votes
1 answer

Can i include custom data in a AWS cloudwatch alarm

You would have routied the alert event ...READ MORE

answered Aug 2, 2018 in DevOps on Cloud by Kalgi
• 41,590 points
46 views
0 votes
1 answer

Deploy multiple platforms to Elastic Beanstalk

Solve by using .ebextentions to run pre-install commands in ...READ MORE

answered Nov 28, 2018 in AWS by Archana
• 5,560 points
69 views
0 votes
1 answer
0 votes
1 answer

How can I remove a port from url for node app using nginx

If you run your node server on ...READ MORE

answered Apr 10, 2018 in DevOps on Cloud by ajs3033
• 7,280 points
539 views