Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pause an Elastic Beanstalk app environment?

I want to shut down the app servers while I upgrade the database.

Is there a way to pause or stop the app servers without terminating/destroying the environment?

Can I just go to the Elastic Beanstalk load balancer and change that temporarily without any issues or consequences to the Elastic Beanstalk configurations or the way it manages its servers?

like image 351
MonkeyBonkey Avatar asked Aug 25 '15 17:08

MonkeyBonkey


People also ask

How do I turn off Autoscaling in Elastic Beanstalk?

On the Automatic scaling tab, under Dynamic scaling policies, select the check box in the top right corner of the desired scaling policy. Scroll to the top of the Dynamic scaling policies section, and choose Actions, Disable.

What are the two environments available in Elastic Beanstalk?

In AWS Elastic Beanstalk, you can create a load-balanced, scalable environment or a single-instance environment. The type of environment that you require depends on the application that you deploy.

Can Elastic Beanstalk version control it's applications?

Elastic Beanstalk creates an application version whenever you upload source code. This usually occurs when you create an environment or upload and deploy code using the environment management console or EB CLI.


1 Answers

This is the only method that worked for me.

1) Go to the environment you want to pause on AWS Management Console

2) Select "Configuration"

3) Open "Capacity"

4) Scroll all the way down to "Time-based Scaling"

5) Click the "Add schedule action" button

6) Set the action to few minutes in the future (recommended: 5 minutes so environment has time to reset), give it a name (for example "terminate") and set minimum and maximum instances to '0':

New scheduled action

Note that times are set in UTC. You can use time.is/UTC to determine the current UTC.

This would create an error that would shut down your environment so you won't have to pay for it. Any other methods suggested just create a error at time of applying so it doesn't pass through and environment would still work.

To re-enable the environment, just schedule another action with instance min 1 and max 4 for example (those are the defaults).

like image 193
Idan Avatar answered Sep 20 '22 17:09

Idan