| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
You can deploy multiple environments when you need to run multiple versions of an application. For example, you might have development, integration, and production environments. When launching, you can deploy a different version to any environment quickly and easily. For more information about deploying with zero downtime, see Deploying Versions with Zero Downtime.
Important
After you create an environment, the environment URL is publicly visible.
To launch a new environment
Open the AWS Elastic Beanstalk console at https://console.aws.amazon.com/elasticbeanstalk/.
From the region list, select a region.
Click Launch New Environment. The Launch New Environment wizard appears.

Describe your new environment's details:
Enter a short descriptive name for the application in the Environment Name box.
This name is then auto-populated in the Environment URL box.
If you want an environment URL that is different than the name of the environment, enter the URL in the Environment URL box.
AWS Elastic Beanstalk will use this name to create a unique CNAME for the environment.
Enter a brief description of the environment in the Description box.
In Version, you can choose from two options:
Click the Select an existing application version option, and select the existing application version from the drop-down list.
Click the Upload and use a new application version option, and click Browse to choose a file to upload.
Select a container type from the Container Type drop-down list.
Note
After you launch a new environment with a container type, you cannot change the container type. If you want to change the container type, you need to launch a new environment.
If you are creating an application using a non-legacy container, then you have the option to associate an Amazon RDS database. If you want to associate an Amazon RDS DB with this application, click Create an RDS Database with this environment. For more information about Amazon RDS, go to Amazon Relational Database Service (Amazon RDS). For a list of supported non-legacy container types, see Why are some container types marked legacy?.
Note
If you are using a legacy container type, then the Amazon RDS option does not appear. For more information about configuring databases with legacy containers, see Configuring Databases with AWS Elastic Beanstalk.
Click Continue to continue to the CONFIGURATION DETAILS pane.

Provide configuration details about your environment.
Select a saved configuration.
The Load a Saved Configuration drop-down list displays a list of configurations that you have saved for your environments. Select a saved configuration that matches the settings you want for your new environment, or select Default.
Select an EC2 instance type.
The Instance Type drop-down list displays the instance types available to your AWS Elastic Beanstalk environment. Select a server with the characteristics (including memory size and CPU power) that are most appropriate to your application.
Note
AWS Elastic Beanstalk is free, but the AWS resources that it provisions might not be. For information on Amazon EC2 usage fees, go to Amazon EC2 Pricing.
For more information about the Amazon EC2 instance types available for your AWS Elastic Beanstalk environment, go to Instance Families and Types in the Amazon Elastic Compute Cloud User Guide.
If you need to securely log in to your Amazon EC2 instances, provide an Amazon EC2 key pair.
You can securely log in to the Amazon EC2 instances provisioned for your AWS Elastic Beanstalk application with an Amazon EC2 key pair.
Important
You must create an Amazon EC2 key pair before you can access your AWS Elastic Beanstalk–provisioned Amazon EC2 instances. You can set up your Amazon EC2 key pairs using the AWS Management Console. For instructions on creating a key pair for Amazon EC2, see the Amazon Elastic Compute Cloud Getting Started Guide.
The Existing Key Pair box lets you specify the name of an Amazon EC2 key pair you use to securely log in to the Amazon EC2 instances running your AWS Elastic Beanstalk application.
For more information about Amazon EC2 key pairs, see Using Credentials in the Amazon Elastic Compute Cloud User Guide. For more information on connecting to Amazon EC2 instances, see Connecting to Instances and Connecting to an Instance from Windows using PuTTY in the Amazon Elastic Compute Cloud User Guide.
If you want to receive email notifications of important events, provide an email address for Amazon Simple Notification Service (Amazon SNS) notifications.
AWS Elastic Beanstalk can notify you of important events regarding your application using Amazon SNS. To enable Amazon SNS notifications, simply enter your email address in the Email Address box. You can disable Amazon SNS notifications at a later time by editing the configuration of your running environment.
If you want to override the default health-check URL, provide a custom health-check URL.
Elastic Load Balancing uses a health check to determine whether the Amazon EC2 instances running your application are healthy. The health check determines an instance's health status by probing a specified URL at a set interval; if the URL returns an error message, or fails to respond within a specified timeout period, the health check fails. AWS Elastic Beanstalk uses Elastic Load Balancing health checks to set the status of your application in the AWS Management Console.
The health check definition includes a URL to be queried for instance health. Override the default URL ("/") by entering the URL you want to check in the Application Health Check URL box.
Select an instance profile.
If you are using a non-legacy container, you have the option to select an instance profile. If you are using a legacy container, this option does not appear in the dialog box. An instance profile provides applications and services access to AWS resources using temporary security credentials. For example, if your application requires access to DynamoDB, it must use AWS security credentials to make an API request. The application can use the temporary security crendentials so you do not have to store long-term credentials on an EC2 instance or update the EC2 instance every time the credentials are rotated. In addition, Elastic Beanstalk requires an instance profile to rotate logs to Amazon S3. The Instance Profile list displays the profiles available for your AWS Elastic Beanstalk environment. If you do not have an instance profile, you can select Create a default instance profile. AWS Elastic Beanstalk creates a default instance profile and updates the Amazon S3 bucket policy to allow log rotation. If you choose to not use the default instance profile, you need to grant permissions for AWS Elastic Beanstalk to rotate logs. For instructions, see Using a Custom Instance Profile. For more information about log rotation, see Configuring Containers with AWS Elastic Beanstalk. For more information about using instance profiles with AWS Elastic Beanstalk, see Using IAM Roles with AWS Elastic Beanstalk.
Note
Users must have permission to create a default profile. For more information, see Granting IAM Users Permissions to Create IAM Roles.
Click Continue. If you are creating an application using a non-legacy container and chose to associate an Amazon RDS DB or create an environment inside a VPC, then another CONFIGURATION pane appears. Otherwise, skip this step and continue to the REVIEW pane details.

Provide configuration details about your Amazon RDS DB.
Select if you want to create a blank Amazon RDS DB or create one from a snapshot. If you choose to create a database from a snapshot, then select a snapshot from the Snapshot list.
Select a database engine from the DB Engine list.
Select a database instance class from the Instance Class list. For information about the DB instance classes, go to http://aws.amazon.com/rds/.
Type the allocated storage for your database in the Allocated Storage box. In some cases, allocating a higher amount of storage for your DB Instance than the size of your database can improve I/O performance. For information about storage allocation, go to Features.
In the Master Username box, type a name using alphanumeric characters that you will use as the master user name to log on to your DB Instance with all database privileges.
In the Master Password box, type a password containing from 8 to 16 printable ASCII characters (excluding /,", and @) for your master user password.
In the Deletion Policy list, select if you want to create a snapshot of your database or delete it if you terminate your AWS Elastic Beanstalk environment.
If you want to configure your database across mutliple Availability Zones, click Multiple Availability Zones. Running your database instance in multiple Availability Zones safeguards your data in the unlikely event of a database instance component failure or service health disruption in one Availability Zone.
Click Continue. The REVIEW pane appears.

Review your new environment settings, and then click Finish.
The new environment is launched. Note that it can take several minutes for the new environment to start while AWS Elastic Beanstalk is provisioning AWS resources.
To launch a new environment
Check if CNAME for the new environment is available.
PROMPT> elastic-beanstalk-check-dns-availability -c [CNAME prefix]
Make sure your application version exists.
PROMPT> elastic-beanstalk-describe-application-versions -a [Application Name] -l [Version Label]
Create a configuration template for an existing application.
PROMPT> elastic-beanstalk-create-configuration-template -a [Application Name] -t [Template Name]
Create environment.
PROMPT> elastic-beanstalk-create-environment -a [Application Name] -l [Version Label] -e [Environment Name] -c [CNAME Prefix] -d [Description] -s [Solution Stack Name] -f [Option Settings File Name
Option Settings are defined in the Options.txt file:
[
{"Namespace": "aws:autoscaling:launchconfiguration",
"OptionName": "IamInstanceProfile",
"Value": ElasticBeanstalkProfile}
]The above option setting defines the IAM instance profile. You can specify the ARN or the profile name.
Determine if the new environment is Green and Ready.
PROMPT> elastic-beanstalk-describe-environments -e [Environment Name]
If the new environment does not come up Green and Ready, you should decide if you want to retry the operation or leave the environment in its current state for investigation. Make sure to terminate the environment after you are finished, and clean up any unused resources.
Note
You can adjust the timeout period if the environment doesn't launch in a reasonable time.
To launch a new environment
Call CheckDNSAvailability with the following
parameter:
CNAMEPrefix =
SampleApp
Example
https://elasticbeanstalk.us-east-1.amazon.com/?CNAMEPrefix=sampleapplication &Operation=CheckDNSAvailability &AuthParams
Call DescribeApplicationVersions with the following
parameters:
ApplicationName =
SampleApp
VersionLabel =
Version2
Example
https://elasticbeanstalk.us-east-1.amazon.com/?ApplicationName=SampleApp &VersionLabel=Version2 &Operation=DescribeApplicationVersions &AuthParams
Call CreateConfigurationTemplate with the following
parameters:
ApplicationName =
SampleApp
TemplateName =
MyConfigTemplate
Example
https://elasticbeanstalk.us-east-1.amazon.com/?ApplicationName=SampleApp &TemplateName=MyConfigTemplate &Operation=CreateConfigurationTemplate &AuthParams
Call CreateEnvironment with the following
parameters:
EnvironmentName =
SampleAppEnv2
VersionLabel =
Version2
Description =
description
TemplateName =
MyConfigTemplate
ApplicationName =
SampleApp
CNAMEPrefix =
sampleapplication
OptionSettings.member.1.Namespace =
aws:autoscaling:launchconfiguration
OptionSettings.member.1.OptionName =
IamInstanceProfile
OptionSettings.member.1.Value =
ElasticBeanstalkProfile
Example
https://elasticbeanstalk.us-east-1.amazon.com/?ApplicationName=SampleApp &VersionLabel=Version2 &EnvironmentName=SampleAppEnv2 &TemplateName=MyConfigTemplate &CNAMEPrefix=sampleapplication &Description=description &Operation=CreateEnvironment &OptionSettings.member.1.Namespace=aws%3Aautoscaling%3Alaunchconfiguration &OptionSettings.member.1.OptionName=IamInstanceProfile &OptionSettings.member.1.Value=ElasticBeanstalkProfile &AuthParams
Call DescribeEnvironments with the following
parameter:
EnvironmentName =
SampleAppEnv2
Example
https://elasticbeanstalk.us-east-1.amazon.com/?EnvironmentName=SampleAppEnv2 &Operation=DescribeEnvironments &AuthParams