Is there any way to stop an elastic beanstalk environment as opposed to terminating it? There are times during testing that I would prefer to stop the environment so that I'm not being charged. However, I'm not seeing a way to do this via the GUI. It is very inconvenient to have to terminate and re-create my environment.
Currently, there's no easy way to suspend an environment. There's also no easy way to have a maintenance page for your environment while your instances are down.
When you set the number of instances to 0, the instances will terminate but you'll have to do this all manually as the EB console does not allow an entry of 0. You can do this by running this:
as-update-auto-scaling-group YourAutoScalingGroupID --min-size 0 --max-size 0 --desired-capacity 0
This, however, only terminates your instances. Everything else is still running, like your ELB. You can then change it back to your previous settings when you're done.
An Amazon Customer found a simple way to do this with single instance environments.
source (Amazon Customer's comment)
When I tried this solution myself I was not able to find Suspend action. Currently, there're only Stop and Terminate actions at Instances tab. And when you choose any, AWS warns you that any data saved to ephemeral storage will be lost.
On AWS Elastic Beanstalk environment, you can use time-based scaling and schedule it to have 0 instance at some time in the future.
You can also use
eb scale count environment-name
to scale it to 0 instance.Check out Pause Elastic Beanstalk instance article for more information.