CfnLaunchConfigurationPropsMixin

class aws_cdk.mixins_preview.aws_autoscaling.mixins.CfnLaunchConfigurationPropsMixin(props, *, strategy=None)

Bases: Mixin

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 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-launchconfiguration.html

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:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

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 x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

BlockDeviceMappingProperty

class CfnLaunchConfigurationPropsMixin.BlockDeviceMappingProperty(*, device_name=None, ebs=None, no_device=None, virtual_name=None)

Bases: object

BlockDeviceMapping specifies a block device mapping for the BlockDeviceMappings 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 (Optional[str]) – The device name assigned to the volume (for example, /dev/sdh or xvdh ). 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 (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 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 is true 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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevicemapping.html

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/sdh or xvdh ).

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`` .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevicemapping.html#cfn-autoscaling-launchconfiguration-blockdevicemapping-devicename

ebs

Information to attach an EBS volume to an instance at launch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevicemapping.html#cfn-autoscaling-launchconfiguration-blockdevicemapping-ebs

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 is true for the root device, instances might fail the EC2 health check. In that case, Amazon EC2 Auto Scaling launches replacement instances.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevicemapping.html#cfn-autoscaling-launchconfiguration-blockdevicemapping-nodevice

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevicemapping.html#cfn-autoscaling-launchconfiguration-blockdevicemapping-virtualname

BlockDeviceProperty

class CfnLaunchConfigurationPropsMixin.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 the EBS 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 is true .

  • 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. For gp3 and io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 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 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 is gp3 or io1 and required only when the volume type is io1 . (Not used with standard , gp2 , st1 , or sc1 volumes.)

  • snapshot_id (Optional[str]) – The snapshot ID of the volume to use. You must specify either a VolumeSize or a SnapshotId .

  • throughput (Union[int, float, None]) – The throughput (MiBps) to provision for a gp3 volume.

  • volume_size (Union[int, float, None]) – The volume size, in GiBs. The following are the supported volumes sizes for each volume type:. - gp2 and gp3 : 1-16,384 - io1 : 4-16,384 - st1 and sc1 : 125-16,384 - standard : 1-1,024 You must specify either a SnapshotId or a VolumeSize . If you specify both SnapshotId and VolumeSize , 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevice.html

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevice.html#cfn-autoscaling-launchconfiguration-blockdevice-deleteontermination

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* .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevice.html#cfn-autoscaling-launchconfiguration-blockdevice-encrypted

iops

The number of input/output (I/O) operations per second (IOPS) to provision for the volume.

For gp3 and io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 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

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 is gp3 or io1 and required only when the volume type is io1 . (Not used with standard , gp2 , st1 , or sc1 volumes.)

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevice.html#cfn-autoscaling-launchconfiguration-blockdevice-iops

snapshot_id

The snapshot ID of the volume to use.

You must specify either a VolumeSize or a SnapshotId .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevice.html#cfn-autoscaling-launchconfiguration-blockdevice-snapshotid

throughput

The throughput (MiBps) to provision for a gp3 volume.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevice.html#cfn-autoscaling-launchconfiguration-blockdevice-throughput

volume_size

.

  • gp2 and gp3 : 1-16,384

  • io1 : 4-16,384

  • st1 and sc1 : 125-16,384

  • standard : 1-1,024

You must specify either a SnapshotId or a VolumeSize . If you specify both SnapshotId and VolumeSize , the volume size must be equal or greater than the size of the snapshot.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevice.html#cfn-autoscaling-launchconfiguration-blockdevice-volumesize

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevice.html#cfn-autoscaling-launchconfiguration-blockdevice-volumetype

MetadataOptionsProperty

class CfnLaunchConfigurationPropsMixin.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 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 (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: 1

  • http_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 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-metadataoptions.html

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.
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-metadataoptions.html#cfn-autoscaling-launchconfiguration-metadataoptions-httpendpoint

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-metadataoptions.html#cfn-autoscaling-launchconfiguration-metadataoptions-httpputresponsehoplimit

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-metadataoptions.html#cfn-autoscaling-launchconfiguration-metadataoptions-httptokens