Configuring Amazon EC2 instances with namespace options
You can use the configuration options in the aws:autoscaling:launchconfiguration
namespace to configure the
instances for your environment, including additional options that aren't available in the console.
Important
The DisableIMDSv1
, RootVolumeType
, or BlockDeviceMappings
option setting can cause Elastic Beanstalk to create an environment with a launch template or update an existing environment from launch configurations to launch
templates. Doing so requires the necessary permissions to manage launch templates. These permissions are included in our managed policy. If you use custom
policies instead of our managed policies, environment creation or updates might fail when you enable spot instances for your environment. For more information
and other considerations, see Launch templates for your Elastic Beanstalk environment.
The following configuration file example uses the basic configuration options that are explained in this topic. To see examples of additional configuration options when you need to specify security groups for load balancers, see Configuring with the AWS CLI.
option_settings:
aws:autoscaling:launchconfiguration:
SecurityGroups: my-securitygroup
MonitoringInterval: "1 minute"
DisableIMDSv1: false
DisableDefaultEC2SecurityGroup: true
SecurityGroups: "sg-abcdef01, sg-abcdef02"
EC2KeyName: my-keypair
IamInstanceProfile: "aws-elasticbeanstalk-ec2-role"
BlockDeviceMappings: "/dev/sdj=:100,/dev/sdh=snap-51eef269,/dev/sdb=ephemeral0"
aws:elasticbeanstalk:environment:
EnvironmentType: SingleInstance
The DisableDefaultEC2SecurityGroup
and BlockDeviceMappings
are not
available in the console.
You can use BlockDeviceMappings
to configure additional block devices for
your instances. For more information, see Block Device Mapping in the
Amazon EC2 User Guide.
The EB CLI and Elastic Beanstalk console apply recommended values for the preceding options. You must remove these settings if you want to use configuration files to configure the same. See Recommended values for details.