AWS Elastic Beanstalk
Developer Guide (API Version 2010-12-01)

Configuring Amazon EC2 Server Instances with Elastic Beanstalk

Amazon EC2 is a web service that enables you to launch and manage server instances in Amazon's data centers. You can use Amazon EC2 server instances at any time, for as long as you need, and for any legal purpose. Instances are available in different sizes and configurations. For more information, go to the Amazon EC2 product page.

AWS Management Console

You can edit the Elastic Beanstalk environment's Amazon EC2 instance configuration by editing Instances on the Configuration page in the environment management console.

Elastic Beanstalk Servers Configuration Window

Amazon EC2 Instance Types

Instance type displays the instance types available to your Elastic Beanstalk application. Change the instance type to select a server with the characteristics (including memory size and CPU power) that are most appropriate to your application. For example, applications with intensive and long-running operations may require more CPU or memory. Elastic Beanstalk regularly checks your running instances to ensure they are healthy. If your application consumes 95 percent or greater of the CPU, Elastic Beanstalk will trigger an event. For more information about this event, see CPU Utilization Exceeds 95.00%.


You cannot change between 32-bit and 64-bit instance types. For example, if your application is built on a 32-bit platform, only 32-bit instance types appear in the list.

For more information about the Amazon EC2 instance types available for your Elastic Beanstalk application, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Security Groups

You can control access to your Elastic Beanstalk application using an Amazon EC2 security group. A security group defines firewall rules for your instances. These rules specify which ingress (i.e., incoming) network traffic should be delivered to your instance. All other ingress traffic will be discarded. You can modify rules for a group at any time. The new rules are automatically enforced for all running instances and instances launched in the future.

You can set up your Amazon EC2 security groups using the Amazon EC2 console. You can specify which Amazon EC2 security groups control access to your Elastic Beanstalk application by entering one or more Amazon EC2 security group names (delimited by commas) into the EC2 security groups text box. For more information on Amazon EC2 security groups, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide.

Elastic Beanstalk creates a default security group for you. You can view the security group name in the EC2 security group box.

EC2 Key Pair

You can securely log in to the Amazon EC2 instances provisioned for your Elastic Beanstalk application with an Amazon EC2 key pair.


You must create an Amazon EC2 key pair and configure your Elastic Beanstalk–provisioned Amazon EC2 instances to use the Amazon EC2 key pair before you can access your 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 EC2 key pair text 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 Elastic Beanstalk application.

For more information on Amazon EC2 key pairs, see Network and Security in the Amazon Elastic Compute Cloud User Guide. For more information on connecting to Amazon EC2 instances, see Connect to Your Instance and Connecting to Linux/UNIX Instances from Windows using PuTTY in the Amazon Elastic Compute Cloud User Guide.

Monitoring Interval

Set the Monitoring interval to 1 minute to increase the frequency with which the resources in your environment publish basic health metrics to CloudWatch.


Amazon CloudWatch service charges can apply for one-minute interval metrics. See Amazon CloudWatch for more information.

Custom AMI ID

The Amazon Machine Image (AMI) is the Amazon Linux or Windows Server machine image that AWS Elastic Beanstalk uses to launch EC2 instances in your environment. Elastic Beanstalk provides machine images that contain the tools and resources required to run your application.

Elastic Beanstalk selects a default AMI for your environment based on the region, platform, and instance type that you choose. If you have created a custom AMI, replace the default AMI ID with yours.

For instructions on creating a custom AMI for use with Elastic Beanstalk, see Creating a Custom Amazon Machine Image (AMI).

Instance Profile

An instance profile is an IAM role that is applied to instances launched in your Elastic Beanstalk environment. EC2 instances assume the instance profile role to sign requests to AWS and access APIs, for example, to write logs to S3.

The first time you create an environment in the AWS Management Console, Elastic Beanstalk prompts you to create an instance profile with a default set of permissions. You can add permissions to this profile to provide your instances access to other AWS services. For details, see Elastic Beanstalk Instance Profile

Root Volume (Boot Device)

You can configure a root volume (otherwise known as a boot device) to attach to Amazon EC2 instances in your Elastic Beanstalk environment. An Amazon EBS volume is a durable, block-level storage device that you can attach to a single Amazon EC2 instance. After a volume is attached to an instance, you can use it like any other physical hard drive. The Root volume type list includes Magnetic, General Purpose (SSD), and Provisioned IOPS (SSD) volume types. Select the volume type that meets your performance and price requirements. For more information, see Amazon EBS Volume Types and Amazon EBS Product Details.

With Root volume size, you can specify the size of the storage volume that you selected. You must specify your desired root volume size if you choose Provisioned IOPS (SSD) as the root volume type that your instances will use. For other root volumes, if you do not specify your own value, Elastic Beanstalk will use the default volume size for the storage volume type. The default volume size varies according to the AMI of the solution stack on which your environment is based. For Provisioned IOPS (SSD) root volumes, the minimum number of gibibytes is 10 and the maximum is 1024. For other root volumes, the minimum number of gibibytes is 8 and the maximum is 1024.

If you selected Provisioned IOPS (SSD) as your root volume type, you must specify your desired input/output operations per second (IOPS). The minimum is 100 and the maximum is 4000. The maximum ratio of IOPS to your volume size is 30 to 1. For example, a volume with 3000 IOPS must be at least 100 GiB.

Block Device Mappings


You cannot configure this option using the AWS Management Console. Use the EB CLI config command or EB Extensions to change the required configuration options in the aws:autoscaling:launchconfiguration namespace.

Although each Amazon Elastic Compute Cloud instance has an associated root device volume upon launch, you can use block device mappings to specify additional Amazon Elastic Block Store volumes or instance store volumes to attach to all the instances in the autoscaling group. For more information about block device mappings, see Block Device Mapping in the Amazon Elastic Cloud Computer User Guide. For more information about instance storage, see Amazon EC2 Instance Store in the Amazon Elastic Cloud Computer User Guide.

Command Line Interface (CLI)

To edit an application's environment settings

  • Update an application's environment settings.

    $ aws elasticbeanstalk update-environment --environment-name my-env --option-settings file://options.txt


        "Namespace": "aws:autoscaling:launchconfiguration",
        "OptionName": "InstanceType",
        "Value": "m1.small"
        "Namespace": "aws:autoscaling:launchconfiguration",
        "OptionName": "SecurityGroups",
        "Value": "awseb-e-98pjjgr9cs-stack-AWSEBSecurityGroup-D1FOQASTKD12"
        "Namespace": "aws:autoscaling:launchconfiguration",
        "OptionName": "EC2KeyName",
        "Value": "mykeypair"
        "Namespace": "aws:autoscaling:launchconfiguration",
        "OptionName": "MonitoringInterval",
        "Value": "5 minute"
        "Namespace": "aws:autoscaling:launchconfiguration",
        "OptionName": "ImageId",
        "Value": "ami-cbab67a2"
        "Namespace": "aws:autoscaling:launchconfiguration",
        "OptionName": "IamInstanceProfile",
        "Value": "ElasticBeanstalkProfile"
        "Namespace": "aws:autoscaling:launchconfiguration",
        "OptionName": "BlockDeviceMappings",
        "Value": "/dev/sdj=:100,/dev/sdh=snap-51eef269,/dev/sdb=ephemeral0"


For information about all the option values you can pass, see Option Values.

To edit an application's environment settings

  • Call UpdateEnvironment with the following parameters:

    • EnvironmentName = SampleAppEnv

    • OptionSettings.member.1.Namespace = aws:autoscaling:launchconfiguration

    • OptionSettings.member.1.OptionName = InstanceType

    • OptionSettings.member.1.Value = m1.small

    • OptionSettings.member.2.Namespace = aws:autoscaling:launchconfiguration

    • OptionSettings.member.2.OptionName = SecurityGroups

    • OptionSettings.member.2.Value = mysecuritygroup

    • OptionSettings.member.3.Namespace = aws:autoscaling:launchconfiguration

    • OptionSettings.member.3.OptionName = EC2KeyName

    • OptionSettings.member.3.Value = mykeypair

    • OptionSettings.member.4.Namespace = aws:autoscaling:launchconfiguration

    • OptionSettings.member.4.OptionName = MonitoringInterval

    • OptionSettings.member.4.Value = 1 minute

    • OptionSettings.member.5.Namespace = aws:autoscaling:launchconfiguration

    • OptionSettings.member.5.OptionName = ImageId

    • OptionSettings.member.5.Value = ami-cbab67a2

    • OptionSettings.member.6.Namespace = aws:autoscaling:launchconfiguration

    • OptionSettings.member.6.OptionName = IamInstanceProfile

    • OptionSettings.member.6.Value = ElasticBeanstalkProfile

    • OptionSettings.member.7.Namespace = aws:autoscaling:launchconfiguration

    • OptionSettings.member.7.OptionName = BlockDeviceMappings

    • OptionSettings.member.7.Value = /dev/sdj=:100,/dev/sdh=snap-51eef269,/dev/sdb=ephemeral0