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.

Note

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.

Important

If you terminate an environment, you must also delete any CNAME mappings that you created, as other customers can reuse an available hostname. Be sure to delete DNS records that point to your terminated environment to prevent a dangling DNS entry. A dangling DNS entry can expose internet traffic destined for your domain to security vulnerabilities. It can also present other risks.

For more information, see Protection from dangling delegation records in Route 53 in the Amazon Route 53 Developer Guide. You can also learn more about dangling DNS entries in Enhanced Domain Protections for Amazon CloudFront Requests in the Amazon Security Blog.

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.

    Note

    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.

    Note

    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

API

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

    EnvironmentName = SampleAppEnv

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