Using Elastic Beanstalk Saved Configurations
You can save your environment's configuration as an object in Amazon S3 that can be applied to other environments during environment creation, or applied to a running environment. Saved configurations are YAML formatted templates that define an environment's platform configuration, tier, configuration option settings, and tags.
Create a saved configuration from the current state of your environment in the Elastic Beanstalk Management Console:
To save an environment's configuration
The saved configuration includes any settings that you have applied to the environment with the console or any other client that uses the Elastic Beanstalk API. You can then apply the saved configuration to your environment at a later date to restore it to its previous state, or apply it to a new environment during environment creation.
To apply a saved configuration during environment creation (AWS Management Console)
Open the Elastic Beanstalk console.
Choose an application.
Choose Saved Configurations.
Choose an saved configuration and then choose Launch environment.
Proceed through the wizard to create your environment.
Saved configurations do not include settings applied with configuration files in your application's source code. If the same setting is applied in both a configuration file and saved configuration, the setting in the saved configuration takes precedence. Likewise, options specified in the AWS Management Console override options in saved configurations. For more information, see Precedence.
Saved configurations are stored in the Elastic Beanstalk S3 bucket in a folder named after your
application. For example, configurations for an application named
my-app in the
us-west-2 region for account number 0123456789012 can be found at
View the contents of a saved configuration by opening it in a text editor. The following example configuration shows the configuration of a web server environment launched with the Elastic Beanstalk Management Console:
EnvironmentConfigurationMetadata: Description: Saved configuration from a multicontainer Docker environment created with the Elastic Beanstalk Management Console DateCreated: '1452824453000' DateModified: '1452824453000' SolutionStack: 64bit Amazon Linux 2015.09 v2.0.6 running Multi-container Docker 1.7.1 (Generic) OptionSettings: aws:elasticbeanstalk:command: BatchSize: '30' BatchSizeType: Percentage aws:elasticbeanstalk:sns:topics: Notification Endpoint: email@example.com aws:elb:policies: ConnectionDrainingEnabled: true ConnectionDrainingTimeout: '20' aws:elb:loadbalancer: CrossZone: true aws:elasticbeanstalk:environment: ServiceRole: aws-elasticbeanstalk-service-role aws:elasticbeanstalk:application: Application Healthcheck URL: / aws:elasticbeanstalk:healthreporting:system: SystemType: enhanced aws:autoscaling:launchconfiguration: IamInstanceProfile: aws-elasticbeanstalk-ec2-role InstanceType: t2.micro EC2KeyName: workstation-uswest2 aws:autoscaling:updatepolicy:rollingupdate: RollingUpdateType: Health RollingUpdateEnabled: true EnvironmentTier: Type: Standard Name: WebServer AWSConfigurationTemplateVersion: 18.104.22.168 Tags: Cost Center: WebApp Dev
You can modify the contents of a saved configuration and save it in the same location in Amazon S3. Any properly formatted saved configuration stored in the right location can be applied to an environment with the Elastic Beanstalk Management Console.
The following keys are supported:
AWSConfigurationTemplateVersion (required) – The configuration template version (22.214.171.124).
SolutionStack – The full name of the solution stack used to create the environment:
64bit Amazon Linux 2015.09 v2.0.6 running Multi-container Docker 1.7.1 (Generic)
OptionSettings – Configuration option settings to apply to the environment. For example, the following entry sets the instance type to t2.micro:
OptionSettings: aws:autoscaling:launchconfiguration: InstanceType: t2.micro
Tags – Up to seven tags to apply to resources created within the environment.
Tags: Cost Center: WebApp Dev
EnvironmentTier – The type of environment to create. For a web server environment, you can exclude this section (web server is the default). For a worker environment, use the following:
EnvironmentTier: Name: Worker Type: SQS/HTTP
CName – The CNAME for the environment. Include a + character at the end of the name to enable groups:
EnvironmentName – The name of the environment to create. Include a + character at the end of the name to enable groups:
With groups enabled, you must specify a group name when you create the environments. Elastic Beanstalk appends the group name to the environment name with a hyphen. For example, with the environment name
front+and the group name
dev, Elastic Beanstalk will create the environment with the name
EnvironmentLinks – A map of variable names and environment names of dependencies. The following example makes the
worker+environment a dependency and tells Elastic Beanstalk to save the link information to a variable named
WORKERQUEUE" : "
The value of the link variable varies depending on the type of the linked environment. For a web server environment, the link is the environment's CNAME. For a worker environment, the link is the name of the environment's Amazon SQS queue.
The CName, EnvironmentName and EnvironmentLinks keys can be used to create environment groups and links to other environments. These features are currently supported when using the EB CLI, AWS CLI or an SDK. When using these features, you can include the saved configuration in your source code as an environment manifest instead of referencing a saved configuration stored in Amazon S3. See the corresponding topics for more information.
See the following topics for alternate methods of creating and applying saved configurations: