Terminate an Elastic Beanstalk environment - Amazon Elastic Beanstalk
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Terminate an Elastic Beanstalk environment

You can terminate a running Amazon Elastic Beanstalk environment using the Elastic Beanstalk console. By doing this, you avoid incurring charges for unused Amazon resources.


You can always launch a new environment using the same version later. If you have data from an environment that you want to preserve, set the database deletion policy to Retain before terminating the environment. This keeps the database operational outside of Elastic Beanstalk. After this, any Elastic Beanstalk environments must connect to it as an external database. If you want to back up the data without keeping the database operational, set the deletion policy to take a snapshot of the database before terminating the environment. For more information, see Database lifecycle in the Configuring environments chapter of this guide.

Elastic Beanstalk might fail to terminate your environment. One common reason is that the security group of another environment has a dependency on the security group of the environment that you want to terminate. For instructions on how to avoid this problem, see Security groups on the EC2 Instances page of this guide.

Elastic Beanstalk console

To terminate an environment
  1. Open the Elastic Beanstalk console, and in the Regions list, select your Amazon Web Services Region.

  2. In the navigation pane, choose Environments, and then choose the name of your environment from the list.


    If you have many environments, use the search bar to filter the environment list.

  3. Choose Actions, and then choose Terminate environment.

  4. Use the on-screen dialog box to confirm environment termination.


    When you terminate your environment, the CNAME that's associated with the terminated environment is freed up to be used by anyone.

    It takes a few minutes for Elastic Beanstalk to terminate the Amazon resources that are running in the environment.

Amazon CLI

To terminate an environment
  • Run the following command.

    $ aws elasticbeanstalk terminate-environment --environment-name my-env


To terminate an environment
  • Call TerminateEnvironment with the following parameter:

    EnvironmentName = SampleAppEnv

    https://elasticbeanstalk.us-west-2.amazon.com/?EnvironmentName=SampleAppEnv &Operation=TerminateEnvironment &AuthParams