CfnLaunchConfiguration
- class aws_cdk.aws_autoscaling.CfnLaunchConfiguration(scope, id, *, image_id, instance_type, associate_public_ip_address=None, block_device_mappings=None, classic_link_vpc_id=None, classic_link_vpc_security_groups=None, ebs_optimized=None, iam_instance_profile=None, instance_id=None, instance_monitoring=None, kernel_id=None, key_name=None, launch_configuration_name=None, metadata_options=None, placement_tenancy=None, ram_disk_id=None, security_groups=None, spot_price=None, user_data=None)
Bases:
CfnResource
A CloudFormation
AWS::AutoScaling::LaunchConfiguration
.The
AWS::AutoScaling::LaunchConfiguration
resource specifies the launch configuration that can be used by an Auto Scaling group to configure Amazon EC2 instances.When you update the launch configuration for an Auto Scaling group, CloudFormation deletes that resource and creates a new launch configuration with the updated properties and a new name. Existing instances are not affected. To update existing instances when you update the
AWS::AutoScaling::LaunchConfiguration
resource, you can specify an UpdatePolicy attribute for the group. You can find sample update policies for rolling updates in Auto scaling template snippets . .. epigraph:Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling group using either a `launch template <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html>`_ or a launch configuration. We strongly recommend that you do not use launch configurations. They do not provide full functionality for Amazon EC2 Auto Scaling or Amazon EC2. For more information, see `Launch configurations <https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-configurations.html>`_ and `Migrate AWS CloudFormation stacks from launch configurations to launch templates <https://docs.aws.amazon.com/autoscaling/ec2/userguide/migrate-launch-configurations-with-cloudformation.html>`_ in the *Amazon EC2 Auto Scaling User Guide* .
- CloudformationResource:
AWS::AutoScaling::LaunchConfiguration
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_autoscaling as autoscaling cfn_launch_configuration = autoscaling.CfnLaunchConfiguration(self, "MyCfnLaunchConfiguration", image_id="imageId", instance_type="instanceType", # the properties below are optional associate_public_ip_address=False, block_device_mappings=[autoscaling.CfnLaunchConfiguration.BlockDeviceMappingProperty( device_name="deviceName", # the properties below are optional ebs=autoscaling.CfnLaunchConfiguration.BlockDeviceProperty( delete_on_termination=False, encrypted=False, iops=123, snapshot_id="snapshotId", throughput=123, volume_size=123, volume_type="volumeType" ), no_device=False, virtual_name="virtualName" )], classic_link_vpc_id="classicLinkVpcId", classic_link_vpc_security_groups=["classicLinkVpcSecurityGroups"], ebs_optimized=False, iam_instance_profile="iamInstanceProfile", instance_id="instanceId", instance_monitoring=False, kernel_id="kernelId", key_name="keyName", launch_configuration_name="launchConfigurationName", metadata_options=autoscaling.CfnLaunchConfiguration.MetadataOptionsProperty( http_endpoint="httpEndpoint", http_put_response_hop_limit=123, http_tokens="httpTokens" ), placement_tenancy="placementTenancy", ram_disk_id="ramDiskId", security_groups=["securityGroups"], spot_price="spotPrice", user_data="userData" )
Create a new
AWS::AutoScaling::LaunchConfiguration
.- Parameters:
scope (
Construct
) –scope in which this resource is defined.
id (
str
) –scoped id of the resource.
image_id (
str
) – The ID of the Amazon Machine Image (AMI) that was assigned during registration. For more information, see Finding a Linux AMI in the Amazon EC2 User Guide for Linux Instances . If you specifyInstanceId
, anImageId
is not required.instance_type (
str
) – Specifies the instance type of the EC2 instance. For information about available instance types, see Available instance types in the Amazon EC2 User Guide for Linux Instances . If you specifyInstanceId
, anInstanceType
is not required.associate_public_ip_address (
Union
[bool
,IResolvable
,None
]) – Specifies whether to assign a public IPv4 address to the group’s instances. If the instance is launched into a default subnet, the default is to assign a public IPv4 address, unless you disabled the option to assign a public IPv4 address on the subnet. If the instance is launched into a nondefault subnet, the default is not to assign a public IPv4 address, unless you enabled the option to assign a public IPv4 address on the subnet. If you specifytrue
, each instance in the Auto Scaling group receives a unique public IPv4 address. For more information, see Launching Auto Scaling instances in a VPC in the Amazon EC2 Auto Scaling User Guide . If you specify this property, you must specify at least one subnet forVPCZoneIdentifier
when you create your group.block_device_mappings (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,BlockDeviceMappingProperty
,Dict
[str
,Any
]]],None
]) – The block device mapping entries that define the block devices to attach to the instances at launch. By default, the block devices specified in the block device mapping for the AMI are used. For more information, see Block device mappings in the Amazon EC2 User Guide for Linux Instances .classic_link_vpc_id (
Optional
[str
]) – Available for backward compatibility.classic_link_vpc_security_groups (
Optional
[Sequence
[str
]]) – Available for backward compatibility.ebs_optimized (
Union
[bool
,IResolvable
,None
]) – Specifies whether the launch configuration is optimized for EBS I/O (true
) or not (false
). The optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization is not available with all instance types. Additional fees are incurred when you enable EBS optimization for an instance type that is not EBS-optimized by default. For more information, see Amazon EBS-optimized instances in the Amazon EC2 User Guide for Linux Instances . The default value isfalse
.iam_instance_profile (
Optional
[str
]) – The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role. For more information, see IAM role for applications that run on Amazon EC2 instances in the Amazon EC2 Auto Scaling User Guide .instance_id (
Optional
[str
]) – The ID of the Amazon EC2 instance to use to create the launch configuration. When you use an instance to create a launch configuration, all properties are derived from the instance with the exception ofBlockDeviceMapping
andAssociatePublicIpAddress
. You can override any properties from the instance by specifying them in the launch configuration.instance_monitoring (
Union
[bool
,IResolvable
,None
]) – Controls whether instances in this group are launched with detailed (true
) or basic (false
) monitoring. The default value istrue
(enabled). .. epigraph:: When detailed monitoring is enabled, Amazon CloudWatch generates metrics every minute and your account is charged a fee. When you disable detailed monitoring, CloudWatch generates metrics every 5 minutes. For more information, see Configure Monitoring for Auto Scaling Instances in the Amazon EC2 Auto Scaling User Guide .kernel_id (
Optional
[str
]) – The ID of the kernel associated with the AMI. .. epigraph:: We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide for Linux Instances .key_name (
Optional
[str
]) – The name of the key pair. For more information, see Amazon EC2 key pairs and Linux instances in the Amazon EC2 User Guide for Linux Instances .launch_configuration_name (
Optional
[str
]) – The name of the launch configuration. This name must be unique per Region per account.metadata_options (
Union
[IResolvable
,MetadataOptionsProperty
,Dict
[str
,Any
],None
]) – The metadata options for the instances. For more information, see Configuring the Instance Metadata Options in the Amazon EC2 Auto Scaling User Guide .placement_tenancy (
Optional
[str
]) – The tenancy of the instance, eitherdefault
ordedicated
. An instance withdedicated
tenancy runs on isolated, single-tenant hardware and can only be launched into a VPC. To launch dedicated instances into a shared tenancy VPC (a VPC with the instance placement tenancy attribute set todefault
), you must set the value of this property todedicated
. For more information, see Configuring instance tenancy with Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide . If you specifyPlacementTenancy
, you must specify at least one subnet forVPCZoneIdentifier
when you create your group. Valid values:default
|dedicated
ram_disk_id (
Optional
[str
]) –The ID of the RAM disk to select. .. epigraph:: We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide for Linux Instances .
security_groups (
Optional
[Sequence
[str
]]) – A list that contains the security groups to assign to the instances in the Auto Scaling group. The list can contain both the IDs of existing security groups and references to SecurityGroup resources created in the template. For more information, see Control traffic to resources using security groups in the Amazon Virtual Private Cloud User Guide .spot_price (
Optional
[str
]) – The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot price. For more information, see Request Spot Instances for fault-tolerant and flexible applications in the Amazon EC2 Auto Scaling User Guide . Valid Range: Minimum value of 0.001 .. epigraph:: When you change your maximum price by creating a new launch configuration, running instances will continue to run as long as the maximum price for those running instances is higher than the current Spot price.user_data (
Optional
[str
]) – The Base64-encoded user data to make available to the launched EC2 instances. For more information, see Instance metadata and user data in the Amazon EC2 User Guide for Linux Instances .
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_depends_on(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.
- Return type:
None
- get_att(attribute_name)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) –tree inspector to collect and process attributes.
- Return type:
None
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::AutoScaling::LaunchConfiguration'
- associate_public_ip_address
Specifies whether to assign a public IPv4 address to the group’s instances.
If the instance is launched into a default subnet, the default is to assign a public IPv4 address, unless you disabled the option to assign a public IPv4 address on the subnet. If the instance is launched into a nondefault subnet, the default is not to assign a public IPv4 address, unless you enabled the option to assign a public IPv4 address on the subnet.
If you specify
true
, each instance in the Auto Scaling group receives a unique public IPv4 address. For more information, see Launching Auto Scaling instances in a VPC in the Amazon EC2 Auto Scaling User Guide .If you specify this property, you must specify at least one subnet for
VPCZoneIdentifier
when you create your group.
- block_device_mappings
The block device mapping entries that define the block devices to attach to the instances at launch.
By default, the block devices specified in the block device mapping for the AMI are used. For more information, see Block device mappings in the Amazon EC2 User Guide for Linux Instances .
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- classic_link_vpc_id
Available for backward compatibility.
- classic_link_vpc_security_groups
Available for backward compatibility.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- ebs_optimized
Specifies whether the launch configuration is optimized for EBS I/O (
true
) or not (false
).The optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization is not available with all instance types. Additional fees are incurred when you enable EBS optimization for an instance type that is not EBS-optimized by default. For more information, see Amazon EBS-optimized instances in the Amazon EC2 User Guide for Linux Instances .
The default value is
false
.
- iam_instance_profile
The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.
The instance profile contains the IAM role. For more information, see IAM role for applications that run on Amazon EC2 instances in the Amazon EC2 Auto Scaling User Guide .
- image_id
The ID of the Amazon Machine Image (AMI) that was assigned during registration.
For more information, see Finding a Linux AMI in the Amazon EC2 User Guide for Linux Instances .
If you specify
InstanceId
, anImageId
is not required.
- instance_id
The ID of the Amazon EC2 instance to use to create the launch configuration.
When you use an instance to create a launch configuration, all properties are derived from the instance with the exception of
BlockDeviceMapping
andAssociatePublicIpAddress
. You can override any properties from the instance by specifying them in the launch configuration.
- instance_monitoring
Controls whether instances in this group are launched with detailed (
true
) or basic (false
) monitoring.The default value is
true
(enabled). .. epigraph:When detailed monitoring is enabled, Amazon CloudWatch generates metrics every minute and your account is charged a fee. When you disable detailed monitoring, CloudWatch generates metrics every 5 minutes. For more information, see `Configure Monitoring for Auto Scaling Instances <https://docs.aws.amazon.com/autoscaling/latest/userguide/enable-as-instance-metrics.html>`_ in the *Amazon EC2 Auto Scaling User Guide* .
- instance_type
Specifies the instance type of the EC2 instance.
For information about available instance types, see Available instance types in the Amazon EC2 User Guide for Linux Instances .
If you specify
InstanceId
, anInstanceType
is not required.
- kernel_id
The ID of the kernel associated with the AMI.
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide for Linux Instances .
- key_name
The name of the key pair.
For more information, see Amazon EC2 key pairs and Linux instances in the Amazon EC2 User Guide for Linux Instances .
- launch_configuration_name
The name of the launch configuration.
This name must be unique per Region per account.
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- metadata_options
The metadata options for the instances.
For more information, see Configuring the Instance Metadata Options in the Amazon EC2 Auto Scaling User Guide .
- node
The construct tree node associated with this construct.
- placement_tenancy
The tenancy of the instance, either
default
ordedicated
.An instance with
dedicated
tenancy runs on isolated, single-tenant hardware and can only be launched into a VPC. To launch dedicated instances into a shared tenancy VPC (a VPC with the instance placement tenancy attribute set todefault
), you must set the value of this property todedicated
. For more information, see Configuring instance tenancy with Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide .If you specify
PlacementTenancy
, you must specify at least one subnet forVPCZoneIdentifier
when you create your group.Valid values:
default
|dedicated
- ram_disk_id
The ID of the RAM disk to select.
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide for Linux Instances .
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- security_groups
A list that contains the security groups to assign to the instances in the Auto Scaling group.
The list can contain both the IDs of existing security groups and references to SecurityGroup resources created in the template.
For more information, see Control traffic to resources using security groups in the Amazon Virtual Private Cloud User Guide .
- spot_price
The maximum hourly price to be paid for any Spot Instance launched to fulfill the request.
Spot Instances are launched when the price you specify exceeds the current Spot price. For more information, see Request Spot Instances for fault-tolerant and flexible applications in the Amazon EC2 Auto Scaling User Guide .
Valid Range: Minimum value of 0.001 .. epigraph:
When you change your maximum price by creating a new launch configuration, running instances will continue to run as long as the maximum price for those running instances is higher than the current Spot price.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- user_data
The Base64-encoded user data to make available to the launched EC2 instances.
For more information, see Instance metadata and user data in the Amazon EC2 User Guide for Linux Instances .
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
) –- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(construct)
Check whether the given construct is a CfnResource.
- Parameters:
construct (
IConstruct
) –- Return type:
bool
- classmethod is_construct(x)
Return whether the given object is a Construct.
- Parameters:
x (
Any
) –- Return type:
bool
BlockDeviceMappingProperty
- class CfnLaunchConfiguration.BlockDeviceMappingProperty(*, device_name, ebs=None, no_device=None, virtual_name=None)
Bases:
object
BlockDeviceMapping
specifies a block device mapping for theBlockDeviceMappings
property of the AWS::AutoScaling::LaunchConfiguration resource.Each instance that is launched has an associated root device volume, either an Amazon EBS volume or an instance store volume. You can use block device mappings to specify additional EBS volumes or instance store volumes to attach to an instance when it is launched.
For more information, see Example block device mapping in the Amazon EC2 User Guide for Linux Instances .
- Parameters:
device_name (
str
) – The device name assigned to the volume (for example,/dev/sdh
orxvdh
). For more information, see Device naming on Linux instances in the Amazon EC2 User Guide for Linux Instances . .. epigraph:: To define a block device mapping, set the device name and exactly one of the following properties:Ebs
,NoDevice
, orVirtualName
.ebs (
Union
[IResolvable
,BlockDeviceProperty
,Dict
[str
,Any
],None
]) – Information to attach an EBS volume to an instance at launch.no_device (
Union
[bool
,IResolvable
,None
]) – Setting this value totrue
prevents a volume that is included in the block device mapping of the AMI from being mapped to the specified device name at launch. IfNoDevice
istrue
for the root device, instances might fail the EC2 health check. In that case, Amazon EC2 Auto Scaling launches replacement instances.virtual_name (
Optional
[str
]) – The name of the instance store volume (virtual device) to attach to an instance at launch. The name must be in the form ephemeral X where X is a number starting from zero (0), for example,ephemeral0
.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_autoscaling as autoscaling block_device_mapping_property = autoscaling.CfnLaunchConfiguration.BlockDeviceMappingProperty( device_name="deviceName", # the properties below are optional ebs=autoscaling.CfnLaunchConfiguration.BlockDeviceProperty( delete_on_termination=False, encrypted=False, iops=123, snapshot_id="snapshotId", throughput=123, volume_size=123, volume_type="volumeType" ), no_device=False, virtual_name="virtualName" )
Attributes
- device_name
The device name assigned to the volume (for example,
/dev/sdh
orxvdh
).For more information, see Device naming on Linux instances in the Amazon EC2 User Guide for Linux Instances . .. epigraph:
To define a block device mapping, set the device name and exactly one of the following properties: ``Ebs`` , ``NoDevice`` , or ``VirtualName`` .
- ebs
Information to attach an EBS volume to an instance at launch.
- no_device
Setting this value to
true
prevents a volume that is included in the block device mapping of the AMI from being mapped to the specified device name at launch.If
NoDevice
istrue
for the root device, instances might fail the EC2 health check. In that case, Amazon EC2 Auto Scaling launches replacement instances.
- virtual_name
The name of the instance store volume (virtual device) to attach to an instance at launch.
The name must be in the form ephemeral X where X is a number starting from zero (0), for example,
ephemeral0
.
BlockDeviceProperty
- class CfnLaunchConfiguration.BlockDeviceProperty(*, delete_on_termination=None, encrypted=None, iops=None, snapshot_id=None, throughput=None, volume_size=None, volume_type=None)
Bases:
object
BlockDevice
is a property of theEBS
property of the AWS::AutoScaling::LaunchConfiguration BlockDeviceMapping property type that describes an Amazon EBS volume.- Parameters:
delete_on_termination (
Union
[bool
,IResolvable
,None
]) – Indicates whether the volume is deleted on instance termination. For Amazon EC2 Auto Scaling, the default value istrue
.encrypted (
Union
[bool
,IResolvable
,None
]) – Specifies whether the volume should be encrypted. Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported instance types . If your AMI uses encrypted volumes, you can also only launch it on supported instance types. .. epigraph:: If you are creating a volume from a snapshot, you cannot create an unencrypted volume from an encrypted snapshot. Also, you cannot specify a KMS key ID when using a launch configuration. If you enable encryption by default, the EBS volumes that you create are always encrypted, either using the AWS managed KMS key or a customer-managed KMS key, regardless of whether the snapshot was encrypted. For more information, see Use AWS KMS keys to encrypt Amazon EBS volumes in the Amazon EC2 Auto Scaling User Guide .iops (
Union
[int
,float
,None
]) – The number of input/output (I/O) operations per second (IOPS) to provision for the volume. Forgp3
andio1
volumes, this represents the number of IOPS that are provisioned for the volume. Forgp2
volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. The following are the supported values for each volume type: -gp3
: 3,000-16,000 IOPS -io1
: 100-64,000 IOPS Forio1
volumes, we guarantee 64,000 IOPS only for Instances built on the Nitro System . Other instance families guarantee performance up to 32,000 IOPS.Iops
is supported when the volume type isgp3
orio1
and required only when the volume type isio1
. (Not used withstandard
,gp2
,st1
, orsc1
volumes.)snapshot_id (
Optional
[str
]) – The snapshot ID of the volume to use. You must specify either aVolumeSize
or aSnapshotId
.throughput (
Union
[int
,float
,None
]) – The throughput (MiBps) to provision for agp3
volume.volume_size (
Union
[int
,float
,None
]) – The volume size, in GiBs. The following are the supported volumes sizes for each volume type:. -gp2
andgp3
: 1-16,384 -io1
: 4-16,384 -st1
andsc1
: 125-16,384 -standard
: 1-1,024 You must specify either aSnapshotId
or aVolumeSize
. If you specify bothSnapshotId
andVolumeSize
, the volume size must be equal or greater than the size of the snapshot.volume_type (
Optional
[str
]) – The volume type. For more information, see Amazon EBS volume types in the Amazon EC2 User Guide for Linux Instances . Valid values:standard
|io1
|gp2
|st1
|sc1
|gp3
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_autoscaling as autoscaling block_device_property = autoscaling.CfnLaunchConfiguration.BlockDeviceProperty( delete_on_termination=False, encrypted=False, iops=123, snapshot_id="snapshotId", throughput=123, volume_size=123, volume_type="volumeType" )
Attributes
- delete_on_termination
Indicates whether the volume is deleted on instance termination.
For Amazon EC2 Auto Scaling, the default value is
true
.
- encrypted
Specifies whether the volume should be encrypted.
Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported instance types . If your AMI uses encrypted volumes, you can also only launch it on supported instance types. .. epigraph:
If you are creating a volume from a snapshot, you cannot create an unencrypted volume from an encrypted snapshot. Also, you cannot specify a KMS key ID when using a launch configuration. If you enable encryption by default, the EBS volumes that you create are always encrypted, either using the AWS managed KMS key or a customer-managed KMS key, regardless of whether the snapshot was encrypted. For more information, see `Use AWS KMS keys to encrypt Amazon EBS volumes <https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-data-protection.html#encryption>`_ in the *Amazon EC2 Auto Scaling User Guide* .
- iops
The number of input/output (I/O) operations per second (IOPS) to provision for the volume.
For
gp3
andio1
volumes, this represents the number of IOPS that are provisioned for the volume. Forgp2
volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.The following are the supported values for each volume type:
gp3
: 3,000-16,000 IOPSio1
: 100-64,000 IOPS
For
io1
volumes, we guarantee 64,000 IOPS only for Instances built on the Nitro System . Other instance families guarantee performance up to 32,000 IOPS.Iops
is supported when the volume type isgp3
orio1
and required only when the volume type isio1
. (Not used withstandard
,gp2
,st1
, orsc1
volumes.)
- snapshot_id
The snapshot ID of the volume to use.
You must specify either a
VolumeSize
or aSnapshotId
.
- throughput
The throughput (MiBps) to provision for a
gp3
volume.
- volume_size
.
gp2
andgp3
: 1-16,384io1
: 4-16,384st1
andsc1
: 125-16,384standard
: 1-1,024
You must specify either a
SnapshotId
or aVolumeSize
. If you specify bothSnapshotId
andVolumeSize
, the volume size must be equal or greater than the size of the snapshot.- Link:
- Type:
The volume size, in GiBs. The following are the supported volumes sizes for each volume type
- volume_type
The volume type.
For more information, see Amazon EBS volume types in the Amazon EC2 User Guide for Linux Instances .
Valid values:
standard
|io1
|gp2
|st1
|sc1
|gp3
MetadataOptionsProperty
- class CfnLaunchConfiguration.MetadataOptionsProperty(*, http_endpoint=None, http_put_response_hop_limit=None, http_tokens=None)
Bases:
object
MetadataOptions
is a property of AWS::AutoScaling::LaunchConfiguration that describes metadata options for the instances.For more information, see Configure the instance metadata options in the Amazon EC2 Auto Scaling User Guide .
- Parameters:
http_endpoint (
Optional
[str
]) – This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default state isenabled
. .. epigraph:: If you specify a value ofdisabled
, you will not be able to access your instance metadata.http_put_response_hop_limit (
Union
[int
,float
,None
]) – The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel. Default: 1http_tokens (
Optional
[str
]) – The state of token usage for your instance metadata requests. If the parameter is not specified in the request, the default state isoptional
. If the state isoptional
, you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role credentials are returned. If the state isrequired
, you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the version 1.0 credentials are not available.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_autoscaling as autoscaling metadata_options_property = autoscaling.CfnLaunchConfiguration.MetadataOptionsProperty( http_endpoint="httpEndpoint", http_put_response_hop_limit=123, http_tokens="httpTokens" )
Attributes
- http_endpoint
This parameter enables or disables the HTTP metadata endpoint on your instances.
If the parameter is not specified, the default state is
enabled
. .. epigraph:If you specify a value of ``disabled`` , you will not be able to access your instance metadata.
- http_put_response_hop_limit
The desired HTTP PUT response hop limit for instance metadata requests.
The larger the number, the further instance metadata requests can travel.
Default: 1
- http_tokens
The state of token usage for your instance metadata requests.
If the parameter is not specified in the request, the default state is
optional
.If the state is
optional
, you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role credentials are returned.If the state is
required
, you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the version 1.0 credentials are not available.