CfnLaunchConfigurationPropsMixin
- class aws_cdk.mixins_preview.aws_autoscaling.mixins.CfnLaunchConfigurationPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::AutoScaling::LaunchConfigurationresource 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::LaunchConfigurationresource, you can specify an UpdatePolicy attribute for the group. You can find sample update policies for rolling updates in Configure Amazon EC2 Auto Scaling resources . .. 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. For more information, see `Launch configurations <https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-configurations.html>`_ in the *Amazon EC2 Auto Scaling User Guide* . For help migrating from launch configurations to launch templates, see `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* .
- See:
- CloudformationResource:
AWS::AutoScaling::LaunchConfiguration
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_autoscaling import mixins as autoscaling_mixins cfn_launch_configuration_props_mixin = autoscaling_mixins.CfnLaunchConfigurationPropsMixin(autoscaling_mixins.CfnLaunchConfigurationMixinProps( associate_public_ip_address=False, block_device_mappings=[autoscaling_mixins.CfnLaunchConfigurationPropsMixin.BlockDeviceMappingProperty( device_name="deviceName", ebs=autoscaling_mixins.CfnLaunchConfigurationPropsMixin.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", image_id="imageId", instance_id="instanceId", instance_monitoring=False, instance_type="instanceType", kernel_id="kernelId", key_name="keyName", launch_configuration_name="launchConfigurationName", metadata_options=autoscaling_mixins.CfnLaunchConfigurationPropsMixin.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" ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::AutoScaling::LaunchConfiguration.- Parameters:
props (
Union[CfnLaunchConfigurationMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['associatePublicIpAddress', 'blockDeviceMappings', 'classicLinkVpcId', 'classicLinkVpcSecurityGroups', 'ebsOptimized', 'iamInstanceProfile', 'imageId', 'instanceId', 'instanceMonitoring', 'instanceType', 'kernelId', 'keyName', 'launchConfigurationName', 'metadataOptions', 'placementTenancy', 'ramDiskId', 'securityGroups', 'spotPrice', 'userData']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
BlockDeviceMappingProperty
- class CfnLaunchConfigurationPropsMixin.BlockDeviceMappingProperty(*, device_name=None, ebs=None, no_device=None, virtual_name=None)
Bases:
objectBlockDeviceMappingspecifies a block device mapping for theBlockDeviceMappingsproperty 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 (
Optional[str]) – The device name assigned to the volume (for example,/dev/sdhorxvdh). For more information, see Device naming on Linux instances in the Amazon EC2 User Guide . .. 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 totrueprevents a volume that is included in the block device mapping of the AMI from being mapped to the specified device name at launch. IfNoDeviceistruefor 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.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_autoscaling import mixins as autoscaling_mixins block_device_mapping_property = autoscaling_mixins.CfnLaunchConfigurationPropsMixin.BlockDeviceMappingProperty( device_name="deviceName", ebs=autoscaling_mixins.CfnLaunchConfigurationPropsMixin.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/sdhorxvdh).For more information, see Device naming on Linux instances in the Amazon EC2 User Guide . .. 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
trueprevents a volume that is included in the block device mapping of the AMI from being mapped to the specified device name at launch.If
NoDeviceistruefor 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 CfnLaunchConfigurationPropsMixin.BlockDeviceProperty(*, delete_on_termination=None, encrypted=None, iops=None, snapshot_id=None, throughput=None, volume_size=None, volume_type=None)
Bases:
objectBlockDeviceis a property of theEBSproperty 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 Requirements for Amazon EBS encryption in the Amazon EBS User Guide . 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. Forgp3andio1volumes, this represents the number of IOPS that are provisioned for the volume. Forgp2volumes, 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 Forio1volumes, we guarantee 64,000 IOPS only for Instances built on the Nitro System . Other instance families guarantee performance up to 32,000 IOPS.Iopsis supported when the volume type isgp3orio1and required only when the volume type isio1. (Not used withstandard,gp2,st1, orsc1volumes.)snapshot_id (
Optional[str]) – The snapshot ID of the volume to use. You must specify either aVolumeSizeor aSnapshotId.throughput (
Union[int,float,None]) – The throughput (MiBps) to provision for agp3volume.volume_size (
Union[int,float,None]) – The volume size, in GiBs. The following are the supported volumes sizes for each volume type:. -gp2andgp3: 1-16,384 -io1: 4-16,384 -st1andsc1: 125-16,384 -standard: 1-1,024 You must specify either aSnapshotIdor aVolumeSize. If you specify bothSnapshotIdandVolumeSize, 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 EBS User Guide . Valid values:standard|io1|gp2|st1|sc1|gp3
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_autoscaling import mixins as autoscaling_mixins block_device_property = autoscaling_mixins.CfnLaunchConfigurationPropsMixin.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 Requirements for Amazon EBS encryption in the Amazon EBS User Guide . 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
gp3andio1volumes, this represents the number of IOPS that are provisioned for the volume. Forgp2volumes, 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
io1volumes, we guarantee 64,000 IOPS only for Instances built on the Nitro System . Other instance families guarantee performance up to 32,000 IOPS.Iopsis supported when the volume type isgp3orio1and required only when the volume type isio1. (Not used withstandard,gp2,st1, orsc1volumes.)
- snapshot_id
The snapshot ID of the volume to use.
You must specify either a
VolumeSizeor aSnapshotId.
- throughput
The throughput (MiBps) to provision for a
gp3volume.
- volume_size
.
gp2andgp3: 1-16,384io1: 4-16,384st1andsc1: 125-16,384standard: 1-1,024
You must specify either a
SnapshotIdor aVolumeSize. If you specify bothSnapshotIdandVolumeSize, the volume size must be equal or greater than the size of the snapshot.- See:
- 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 EBS User Guide .
Valid values:
standard|io1|gp2|st1|sc1|gp3
MetadataOptionsProperty
- class CfnLaunchConfigurationPropsMixin.MetadataOptionsProperty(*, http_endpoint=None, http_put_response_hop_limit=None, http_tokens=None)
Bases:
objectMetadataOptionsis 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.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_autoscaling import mixins as autoscaling_mixins metadata_options_property = autoscaling_mixins.CfnLaunchConfigurationPropsMixin.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.