CfnInstancePropsMixin

class aws_cdk.mixins_preview.aws_ec2.mixins.CfnInstancePropsMixin(props, *, strategy=None)

Bases: Mixin

Specifies an EC2 instance.

If an Elastic IP address is attached to your instance, AWS CloudFormation reattaches the Elastic IP address after it updates the instance. For more information about updating stacks, see AWS CloudFormation Stacks Updates .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html

CloudformationResource:

AWS::EC2::Instance

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_ec2 import mixins as ec2_mixins

cfn_instance_props_mixin = ec2_mixins.CfnInstancePropsMixin(ec2_mixins.CfnInstanceMixinProps(
    additional_info="additionalInfo",
    affinity="affinity",
    availability_zone="availabilityZone",
    block_device_mappings=[ec2_mixins.CfnInstancePropsMixin.BlockDeviceMappingProperty(
        device_name="deviceName",
        ebs=ec2_mixins.CfnInstancePropsMixin.EbsProperty(
            delete_on_termination=False,
            encrypted=False,
            iops=123,
            kms_key_id="kmsKeyId",
            snapshot_id="snapshotId",
            volume_size=123,
            volume_type="volumeType"
        ),
        no_device=ec2_mixins.CfnInstancePropsMixin.NoDeviceProperty(),
        virtual_name="virtualName"
    )],
    cpu_options=ec2_mixins.CfnInstancePropsMixin.CpuOptionsProperty(
        core_count=123,
        threads_per_core=123
    ),
    credit_specification=ec2_mixins.CfnInstancePropsMixin.CreditSpecificationProperty(
        cpu_credits="cpuCredits"
    ),
    disable_api_termination=False,
    ebs_optimized=False,
    elastic_gpu_specifications=[ec2_mixins.CfnInstancePropsMixin.ElasticGpuSpecificationProperty(
        type="type"
    )],
    elastic_inference_accelerators=[ec2_mixins.CfnInstancePropsMixin.ElasticInferenceAcceleratorProperty(
        count=123,
        type="type"
    )],
    enclave_options=ec2_mixins.CfnInstancePropsMixin.EnclaveOptionsProperty(
        enabled=False
    ),
    hibernation_options=ec2_mixins.CfnInstancePropsMixin.HibernationOptionsProperty(
        configured=False
    ),
    host_id="hostId",
    host_resource_group_arn="hostResourceGroupArn",
    iam_instance_profile="iamInstanceProfile",
    image_id="imageId",
    instance_initiated_shutdown_behavior="instanceInitiatedShutdownBehavior",
    instance_type="instanceType",
    ipv6_address_count=123,
    ipv6_addresses=[ec2_mixins.CfnInstancePropsMixin.InstanceIpv6AddressProperty(
        ipv6_address="ipv6Address"
    )],
    kernel_id="kernelId",
    key_name="keyName",
    launch_template=ec2_mixins.CfnInstancePropsMixin.LaunchTemplateSpecificationProperty(
        launch_template_id="launchTemplateId",
        launch_template_name="launchTemplateName",
        version="version"
    ),
    license_specifications=[ec2_mixins.CfnInstancePropsMixin.LicenseSpecificationProperty(
        license_configuration_arn="licenseConfigurationArn"
    )],
    metadata_options=ec2_mixins.CfnInstancePropsMixin.MetadataOptionsProperty(
        http_endpoint="httpEndpoint",
        http_protocol_ipv6="httpProtocolIpv6",
        http_put_response_hop_limit=123,
        http_tokens="httpTokens",
        instance_metadata_tags="instanceMetadataTags"
    ),
    monitoring=False,
    network_interfaces=[ec2_mixins.CfnInstancePropsMixin.NetworkInterfaceProperty(
        associate_carrier_ip_address=False,
        associate_public_ip_address=False,
        delete_on_termination=False,
        description="description",
        device_index="deviceIndex",
        ena_srd_specification=ec2_mixins.CfnInstancePropsMixin.EnaSrdSpecificationProperty(
            ena_srd_enabled=False,
            ena_srd_udp_specification=ec2_mixins.CfnInstancePropsMixin.EnaSrdUdpSpecificationProperty(
                ena_srd_udp_enabled=False
            )
        ),
        group_set=["groupSet"],
        ipv6_address_count=123,
        ipv6_addresses=[ec2_mixins.CfnInstancePropsMixin.InstanceIpv6AddressProperty(
            ipv6_address="ipv6Address"
        )],
        network_interface_id="networkInterfaceId",
        private_ip_address="privateIpAddress",
        private_ip_addresses=[ec2_mixins.CfnInstancePropsMixin.PrivateIpAddressSpecificationProperty(
            primary=False,
            private_ip_address="privateIpAddress"
        )],
        secondary_private_ip_address_count=123,
        subnet_id="subnetId"
    )],
    placement_group_name="placementGroupName",
    private_dns_name_options=ec2_mixins.CfnInstancePropsMixin.PrivateDnsNameOptionsProperty(
        enable_resource_name_dns_aaaa_record=False,
        enable_resource_name_dns_aRecord=False,
        hostname_type="hostnameType"
    ),
    private_ip_address="privateIpAddress",
    propagate_tags_to_volume_on_creation=False,
    ramdisk_id="ramdiskId",
    security_group_ids=["securityGroupIds"],
    security_groups=["securityGroups"],
    source_dest_check=False,
    ssm_associations=[ec2_mixins.CfnInstancePropsMixin.SsmAssociationProperty(
        association_parameters=[ec2_mixins.CfnInstancePropsMixin.AssociationParameterProperty(
            key="key",
            value=["value"]
        )],
        document_name="documentName"
    )],
    subnet_id="subnetId",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    tenancy="tenancy",
    user_data="userData",
    volumes=[ec2_mixins.CfnInstancePropsMixin.VolumeProperty(
        device="device",
        volume_id="volumeId"
    )]
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::EC2::Instance.

Parameters:
  • props (Union[CfnInstanceMixinProps, 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:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['additionalInfo', 'affinity', 'availabilityZone', 'blockDeviceMappings', 'cpuOptions', 'creditSpecification', 'disableApiTermination', 'ebsOptimized', 'elasticGpuSpecifications', 'elasticInferenceAccelerators', 'enclaveOptions', 'hibernationOptions', 'hostId', 'hostResourceGroupArn', 'iamInstanceProfile', 'imageId', 'instanceInitiatedShutdownBehavior', 'instanceType', 'ipv6AddressCount', 'ipv6Addresses', 'kernelId', 'keyName', 'launchTemplate', 'licenseSpecifications', 'metadataOptions', 'monitoring', 'networkInterfaces', 'placementGroupName', 'privateDnsNameOptions', 'privateIpAddress', 'propagateTagsToVolumeOnCreation', 'ramdiskId', 'securityGroupIds', 'securityGroups', 'sourceDestCheck', 'ssmAssociations', 'subnetId', 'tags', 'tenancy', 'userData', 'volumes']

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

AssociationParameterProperty

class CfnInstancePropsMixin.AssociationParameterProperty(*, key=None, value=None)

Bases: object

Specifies input parameter values for an SSM document in AWS Systems Manager .

AssociationParameter is a property of the SsmAssociation property type.

Parameters:
  • key (Optional[str]) – The name of an input parameter that is in the associated SSM document.

  • value (Optional[Sequence[str]]) – The value of an input parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-associationparameter.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_ec2 import mixins as ec2_mixins

association_parameter_property = ec2_mixins.CfnInstancePropsMixin.AssociationParameterProperty(
    key="key",
    value=["value"]
)

Attributes

key

The name of an input parameter that is in the associated SSM document.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-associationparameter.html#cfn-ec2-instance-associationparameter-key

value

The value of an input parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-associationparameter.html#cfn-ec2-instance-associationparameter-value

BlockDeviceMappingProperty

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

Bases: object

Specifies a block device mapping for an instance.

You must specify exactly one of the following properties: VirtualName , Ebs , or NoDevice .

BlockDeviceMapping is a property of the AWS::EC2::Instance resource. .. epigraph:

After the instance is running, you can modify only the ``DeleteOnTermination`` parameter for the attached volumes without interrupting the instance. Modifying any other parameter results in instance `replacement <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement>`_ .
Parameters:
  • device_name (Optional[str]) – The device name. For available device names, see Device names for volumes . .. epigraph:: After the instance is running, this parameter is used to specify the device name of the block device mapping to update.

  • ebs (Union[IResolvable, EbsProperty, Dict[str, Any], None]) – Parameters used to automatically set up EBS volumes when the instance is launched. .. epigraph:: After the instance is running, you can modify only the DeleteOnTermination parameter for the attached volumes without interrupting the instance. Modifying any other parameter results in instance replacement .

  • no_device (Union[IResolvable, NoDeviceProperty, Dict[str, Any], None]) –

    To omit the device from the block device mapping, specify an empty string. .. epigraph:: After the instance is running, modifying this parameter results in instance replacement .

  • virtual_name (Optional[str]) –

    The virtual device name ( ephemeral N). The name must be in the form ephemeral X where X is a number starting from zero (0). For example, an instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume. NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect. Constraints : For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI. .. epigraph:: After the instance is running, modifying this parameter results in instance replacement .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-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_ec2 import mixins as ec2_mixins

block_device_mapping_property = ec2_mixins.CfnInstancePropsMixin.BlockDeviceMappingProperty(
    device_name="deviceName",
    ebs=ec2_mixins.CfnInstancePropsMixin.EbsProperty(
        delete_on_termination=False,
        encrypted=False,
        iops=123,
        kms_key_id="kmsKeyId",
        snapshot_id="snapshotId",
        volume_size=123,
        volume_type="volumeType"
    ),
    no_device=ec2_mixins.CfnInstancePropsMixin.NoDeviceProperty(),
    virtual_name="virtualName"
)

Attributes

device_name

The device name. For available device names, see Device names for volumes .

After the instance is running, this parameter is used to specify the device name of the block device mapping to update.

See:

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

ebs

Parameters used to automatically set up EBS volumes when the instance is launched.

After the instance is running, you can modify only the DeleteOnTermination parameter for the attached volumes without interrupting the instance. Modifying any other parameter results in instance replacement .

See:

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

no_device

To omit the device from the block device mapping, specify an empty string.

After the instance is running, modifying this parameter results in instance replacement .

See:

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

virtual_name

The virtual device name ( ephemeral N).

The name must be in the form ephemeral X where X is a number starting from zero (0). For example, an instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.

Constraints : For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI. .. epigraph:

After the instance is running, modifying this parameter results in instance `replacement <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement>`_ .
See:

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

CpuOptionsProperty

class CfnInstancePropsMixin.CpuOptionsProperty(*, core_count=None, threads_per_core=None)

Bases: object

Specifies the CPU options for the instance.

When you specify CPU options, you must specify both the number of CPU cores and threads per core.

Modifying the CPU options for an instance results in instance replacement .

For more information, see Optimize CPU options in the Amazon Elastic Compute Cloud User Guide .

Parameters:
  • core_count (Union[int, float, None]) – The number of CPU cores for the instance.

  • threads_per_core (Union[int, float, None]) – The number of threads per CPU core.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-cpuoptions.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_ec2 import mixins as ec2_mixins

cpu_options_property = ec2_mixins.CfnInstancePropsMixin.CpuOptionsProperty(
    core_count=123,
    threads_per_core=123
)

Attributes

core_count

The number of CPU cores for the instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-cpuoptions.html#cfn-ec2-instance-cpuoptions-corecount

threads_per_core

The number of threads per CPU core.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-cpuoptions.html#cfn-ec2-instance-cpuoptions-threadspercore

CreditSpecificationProperty

class CfnInstancePropsMixin.CreditSpecificationProperty(*, cpu_credits=None)

Bases: object

Specifies the credit option for CPU usage of a T instance.

CreditSpecification is a property of the AWS::EC2::Instance resource.

For more information, see Burstable performance instances in the Amazon EC2 User Guide .

Parameters:

cpu_credits (Optional[str]) – The credit option for CPU usage of the instance. Valid values: standard | unlimited T3 instances with host tenancy do not support the unlimited CPU credit option.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-creditspecification.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_ec2 import mixins as ec2_mixins

credit_specification_property = ec2_mixins.CfnInstancePropsMixin.CreditSpecificationProperty(
    cpu_credits="cpuCredits"
)

Attributes

cpu_credits

The credit option for CPU usage of the instance.

Valid values: standard | unlimited

T3 instances with host tenancy do not support the unlimited CPU credit option.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-creditspecification.html#cfn-ec2-instance-creditspecification-cpucredits

EbsProperty

class CfnInstancePropsMixin.EbsProperty(*, delete_on_termination=None, encrypted=None, iops=None, kms_key_id=None, snapshot_id=None, volume_size=None, volume_type=None)

Bases: object

Specifies a block device for an EBS volume.

Ebs is a property of the BlockDeviceMapping property type. .. epigraph:

After the instance is running, you can modify only the ``DeleteOnTermination`` parameters for the attached volumes without interrupting the instance. Modifying any other parameter results in instance `replacement <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement>`_ .
Parameters:
  • delete_on_termination (Union[bool, IResolvable, None]) – Indicates whether the EBS volume is deleted on instance termination. For more information, see Preserving Amazon EBS volumes on instance termination in the Amazon EC2 User Guide .

  • encrypted (Union[bool, IResolvable, None]) –

    Indicates whether the volume should be encrypted. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Encryption by default in the Amazon Elastic Compute Cloud User Guide . Encrypted Amazon EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Supported instance types . .. epigraph:: After the instance is running, modifying this parameter results in instance replacement .

  • iops (Union[int, float, None]) –

    The number of I/O operations per second (IOPS). For gp3 , io1 , and io2 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 - io2 : 100-64,000 IOPS For io1 and io2 volumes, we guarantee 64,000 IOPS only for Instances built on the Nitro System . Other instance families guarantee performance up to 32,000 IOPS. This parameter is required for io1 and io2 volumes. The default for gp3 volumes is 3,000 IOPS. This parameter is not supported for gp2 , st1 , sc1 , or standard volumes. .. epigraph:: After the instance is running, modifying this parameter results in instance replacement .

  • kms_key_id (Optional[str]) –

    The identifier of the AWS KMS key to use for Amazon EBS encryption. If KmsKeyId is specified, the encrypted state must be true . If the encrypted state is true but you do not specify KmsKeyId , your KMS key for EBS is used. You can specify the KMS key using any of the following: - Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab. - Key alias. For example, alias/ExampleAlias. - Key ARN. For example, arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab. - Alias ARN. For example, arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias. .. epigraph:: After the instance is running, modifying this parameter results in instance replacement .

  • snapshot_id (Optional[str]) –

    The ID of the snapshot. If you specify both SnapshotId and VolumeSize , VolumeSize must be equal or greater than the size of the snapshot. .. epigraph:: After the instance is running, modifying this parameter results in instance replacement .

  • volume_size (Union[int, float, None]) –

    The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the snapshot size. The following are the supported volumes sizes for each volume type: - gp2 and gp3 :1-16,384 - io1 and io2 : 4-16,384 - st1 and sc1 : 125-16,384 - standard : 1-1,024 .. epigraph:: After the instance is running, modifying this parameter results in instance replacement .

  • volume_type (Optional[str]) –

    The volume type. For more information, see Amazon EBS volume types in the Amazon EC2 User Guide . If the volume type is io1 or io2 , you must specify the IOPS that the volume supports. .. epigraph:: After the instance is running, modifying this parameter results in instance replacement .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-ebs.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_ec2 import mixins as ec2_mixins

ebs_property = ec2_mixins.CfnInstancePropsMixin.EbsProperty(
    delete_on_termination=False,
    encrypted=False,
    iops=123,
    kms_key_id="kmsKeyId",
    snapshot_id="snapshotId",
    volume_size=123,
    volume_type="volumeType"
)

Attributes

delete_on_termination

Indicates whether the EBS volume is deleted on instance termination.

For more information, see Preserving Amazon EBS volumes on instance termination in the Amazon EC2 User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-ebs.html#cfn-ec2-instance-ebs-deleteontermination

encrypted

Indicates whether the volume should be encrypted.

The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Encryption by default in the Amazon Elastic Compute Cloud User Guide .

Encrypted Amazon EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Supported instance types . .. epigraph:

After the instance is running, modifying this parameter results in instance `replacement <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement>`_ .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-ebs.html#cfn-ec2-instance-ebs-encrypted

iops

The number of I/O operations per second (IOPS).

For gp3 , io1 , and io2 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

  • io2 : 100-64,000 IOPS

For io1 and io2 volumes, we guarantee 64,000 IOPS only for Instances built on the Nitro System . Other instance families guarantee performance up to 32,000 IOPS.

This parameter is required for io1 and io2 volumes. The default for gp3 volumes is 3,000 IOPS. This parameter is not supported for gp2 , st1 , sc1 , or standard volumes. .. epigraph:

After the instance is running, modifying this parameter results in instance `replacement <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement>`_ .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-ebs.html#cfn-ec2-instance-ebs-iops

kms_key_id

The identifier of the AWS KMS key to use for Amazon EBS encryption.

If KmsKeyId is specified, the encrypted state must be true . If the encrypted state is true but you do not specify KmsKeyId , your KMS key for EBS is used.

You can specify the KMS key using any of the following:

  • Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.

  • Key alias. For example, alias/ExampleAlias.

  • Key ARN. For example, arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

  • Alias ARN. For example, arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias.

After the instance is running, modifying this parameter results in instance replacement .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-ebs.html#cfn-ec2-instance-ebs-kmskeyid

snapshot_id

The ID of the snapshot.

If you specify both SnapshotId and VolumeSize , VolumeSize must be equal or greater than the size of the snapshot. .. epigraph:

After the instance is running, modifying this parameter results in instance `replacement <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement>`_ .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-ebs.html#cfn-ec2-instance-ebs-snapshotid

volume_size

The size of the volume, in GiBs.

You must specify either a snapshot ID or a volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the snapshot size.

The following are the supported volumes sizes for each volume type:

  • gp2 and gp3 :1-16,384

  • io1 and io2 : 4-16,384

  • st1 and sc1 : 125-16,384

  • standard : 1-1,024

After the instance is running, modifying this parameter results in instance replacement .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-ebs.html#cfn-ec2-instance-ebs-volumesize

volume_type

The volume type.

For more information, see Amazon EBS volume types in the Amazon EC2 User Guide . If the volume type is io1 or io2 , you must specify the IOPS that the volume supports. .. epigraph:

After the instance is running, modifying this parameter results in instance `replacement <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement>`_ .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-ebs.html#cfn-ec2-instance-ebs-volumetype

ElasticGpuSpecificationProperty

class CfnInstancePropsMixin.ElasticGpuSpecificationProperty(*, type=None)

Bases: object

Amazon Elastic Graphics reached end of life on January 8, 2024.

Specifies the type of Elastic GPU. An Elastic GPU is a GPU resource that you can attach to your Amazon EC2 instance to accelerate the graphics performance of your applications.

ElasticGpuSpecification is a property of the AWS::EC2::Instance resource.

Attributes

type

The type of Elastic Graphics accelerator.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-elasticgpuspecification.html#cfn-ec2-instance-elasticgpuspecification-type

ElasticInferenceAcceleratorProperty

class CfnInstancePropsMixin.ElasticInferenceAcceleratorProperty(*, count=None, type=None)

Bases: object

Amazon Elastic Inference is no longer available.

Specifies the Elastic Inference Accelerator for the instance.

ElasticInferenceAccelerator is a property of the AWS::EC2::Instance resource.

Attributes

count

The number of elastic inference accelerators to attach to the instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-elasticinferenceaccelerator.html#cfn-ec2-instance-elasticinferenceaccelerator-count

type

The type of elastic inference accelerator.

The possible values are eia1.medium , eia1.large , eia1.xlarge , eia2.medium , eia2.large , and eia2.xlarge .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-elasticinferenceaccelerator.html#cfn-ec2-instance-elasticinferenceaccelerator-type

EnaSrdSpecificationProperty

class CfnInstancePropsMixin.EnaSrdSpecificationProperty(*, ena_srd_enabled=None, ena_srd_udp_specification=None)

Bases: object

ENA Express uses AWS Scalable Reliable Datagram (SRD) technology to increase the maximum bandwidth used per stream and minimize tail latency of network traffic between EC2 instances.

With ENA Express, you can communicate between two EC2 instances in the same subnet within the same account, or in different accounts. Both sending and receiving instances must have ENA Express enabled.

To improve the reliability of network packet delivery, ENA Express reorders network packets on the receiving end by default. However, some UDP-based applications are designed to handle network packets that are out of order to reduce the overhead for packet delivery at the network layer. When ENA Express is enabled, you can specify whether UDP network traffic uses it.

Parameters:
  • ena_srd_enabled (Union[bool, IResolvable, None]) – Indicates whether ENA Express is enabled for the network interface.

  • ena_srd_udp_specification (Union[IResolvable, EnaSrdUdpSpecificationProperty, Dict[str, Any], None]) – Configures ENA Express for UDP network traffic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-enasrdspecification.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_ec2 import mixins as ec2_mixins

ena_srd_specification_property = ec2_mixins.CfnInstancePropsMixin.EnaSrdSpecificationProperty(
    ena_srd_enabled=False,
    ena_srd_udp_specification=ec2_mixins.CfnInstancePropsMixin.EnaSrdUdpSpecificationProperty(
        ena_srd_udp_enabled=False
    )
)

Attributes

ena_srd_enabled

Indicates whether ENA Express is enabled for the network interface.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-enasrdspecification.html#cfn-ec2-instance-enasrdspecification-enasrdenabled

ena_srd_udp_specification

Configures ENA Express for UDP network traffic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-enasrdspecification.html#cfn-ec2-instance-enasrdspecification-enasrdudpspecification

EnaSrdUdpSpecificationProperty

class CfnInstancePropsMixin.EnaSrdUdpSpecificationProperty(*, ena_srd_udp_enabled=None)

Bases: object

ENA Express is compatible with both TCP and UDP transport protocols.

When it’s enabled, TCP traffic automatically uses it. However, some UDP-based applications are designed to handle network packets that are out of order, without a need for retransmission, such as live video broadcasting or other near-real-time applications. For UDP traffic, you can specify whether to use ENA Express, based on your application environment needs.

Parameters:

ena_srd_udp_enabled (Union[bool, IResolvable, None]) – Indicates whether UDP traffic to and from the instance uses ENA Express. To specify this setting, you must first enable ENA Express.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-enasrdudpspecification.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_ec2 import mixins as ec2_mixins

ena_srd_udp_specification_property = ec2_mixins.CfnInstancePropsMixin.EnaSrdUdpSpecificationProperty(
    ena_srd_udp_enabled=False
)

Attributes

ena_srd_udp_enabled

Indicates whether UDP traffic to and from the instance uses ENA Express.

To specify this setting, you must first enable ENA Express.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-enasrdudpspecification.html#cfn-ec2-instance-enasrdudpspecification-enasrdudpenabled

EnclaveOptionsProperty

class CfnInstancePropsMixin.EnclaveOptionsProperty(*, enabled=None)

Bases: object

Indicates whether the instance is enabled for AWS Nitro Enclaves.

Parameters:

enabled (Union[bool, IResolvable, None]) – If this parameter is set to true , the instance is enabled for AWS Nitro Enclaves; otherwise, it is not enabled for AWS Nitro Enclaves.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-enclaveoptions.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_ec2 import mixins as ec2_mixins

enclave_options_property = ec2_mixins.CfnInstancePropsMixin.EnclaveOptionsProperty(
    enabled=False
)

Attributes

enabled

If this parameter is set to true , the instance is enabled for AWS Nitro Enclaves;

otherwise, it is not enabled for AWS Nitro Enclaves.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-enclaveoptions.html#cfn-ec2-instance-enclaveoptions-enabled

HibernationOptionsProperty

class CfnInstancePropsMixin.HibernationOptionsProperty(*, configured=None)

Bases: object

Specifies the hibernation options for the instance.

HibernationOptions is a property of the AWS::EC2::Instance resource.

Parameters:

configured (Union[bool, IResolvable, None]) – Set to true to enable your instance for hibernation. For Spot Instances, if you set Configured to true , either omit the InstanceInterruptionBehavior parameter (for `SpotMarketOptions <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotMarketOptions.html>`_ ), or set it to hibernate . When Configured is true: - If you omit InstanceInterruptionBehavior , it defaults to hibernate . - If you set InstanceInterruptionBehavior to a value other than hibernate , you’ll get an error. Default: false Default: - false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-hibernationoptions.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_ec2 import mixins as ec2_mixins

hibernation_options_property = ec2_mixins.CfnInstancePropsMixin.HibernationOptionsProperty(
    configured=False
)

Attributes

configured

Set to true to enable your instance for hibernation.

For Spot Instances, if you set Configured to true , either omit the InstanceInterruptionBehavior parameter (for `SpotMarketOptions <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotMarketOptions.html>`_ ), or set it to hibernate . When Configured is true:

  • If you omit InstanceInterruptionBehavior , it defaults to hibernate .

  • If you set InstanceInterruptionBehavior to a value other than hibernate , you’ll get an error.

Default: false

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-hibernationoptions.html#cfn-ec2-instance-hibernationoptions-configured

InstanceIpv6AddressProperty

class CfnInstancePropsMixin.InstanceIpv6AddressProperty(*, ipv6_address=None)

Bases: object

Specifies the IPv6 address for the instance.

InstanceIpv6Address is a property of the AWS::EC2::Instance resource.

Parameters:

ipv6_address (Optional[str]) – The IPv6 address.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-instanceipv6address.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_ec2 import mixins as ec2_mixins

instance_ipv6_address_property = ec2_mixins.CfnInstancePropsMixin.InstanceIpv6AddressProperty(
    ipv6_address="ipv6Address"
)

Attributes

ipv6_address

The IPv6 address.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-instanceipv6address.html#cfn-ec2-instance-instanceipv6address-ipv6address

LaunchTemplateSpecificationProperty

class CfnInstancePropsMixin.LaunchTemplateSpecificationProperty(*, launch_template_id=None, launch_template_name=None, version=None)

Bases: object

Specifies a launch template to use when launching an Amazon EC2 instance.

You must specify the following:

  • The ID or the name of the launch template, but not both.

  • The version of the launch template.

For information about creating a launch template, see AWS::EC2::LaunchTemplate and Create a launch template in the Amazon EC2 User Guide . For example launch templates, see the Examples for AWS::EC2::LaunchTemplate .

Parameters:
  • launch_template_id (Optional[str]) – The ID of the launch template. You must specify either the launch template ID or the launch template name, but not both.

  • launch_template_name (Optional[str]) – The name of the launch template. You must specify either the launch template ID or the launch template name, but not both.

  • version (Optional[str]) – The version number of the launch template. You must specify this property. To specify the default version of the template, use the Fn::GetAtt intrinsic function to retrieve the DefaultVersionNumber attribute of the launch template. To specify the latest version of the template, use Fn::GetAtt to retrieve the LatestVersionNumber attribute. For more information, see AWS::EC2:LaunchTemplate return values for Fn::GetAtt .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-launchtemplatespecification.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_ec2 import mixins as ec2_mixins

launch_template_specification_property = ec2_mixins.CfnInstancePropsMixin.LaunchTemplateSpecificationProperty(
    launch_template_id="launchTemplateId",
    launch_template_name="launchTemplateName",
    version="version"
)

Attributes

launch_template_id

The ID of the launch template.

You must specify either the launch template ID or the launch template name, but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-launchtemplatespecification.html#cfn-ec2-instance-launchtemplatespecification-launchtemplateid

launch_template_name

The name of the launch template.

You must specify either the launch template ID or the launch template name, but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-launchtemplatespecification.html#cfn-ec2-instance-launchtemplatespecification-launchtemplatename

version

The version number of the launch template. You must specify this property.

To specify the default version of the template, use the Fn::GetAtt intrinsic function to retrieve the DefaultVersionNumber attribute of the launch template. To specify the latest version of the template, use Fn::GetAtt to retrieve the LatestVersionNumber attribute. For more information, see AWS::EC2:LaunchTemplate return values for Fn::GetAtt .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-launchtemplatespecification.html#cfn-ec2-instance-launchtemplatespecification-version

LicenseSpecificationProperty

class CfnInstancePropsMixin.LicenseSpecificationProperty(*, license_configuration_arn=None)

Bases: object

Specifies the license configuration to use.

LicenseSpecification is a property of the AWS::EC2::Instance resource.

Parameters:

license_configuration_arn (Optional[str]) – The Amazon Resource Name (ARN) of the license configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-licensespecification.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_ec2 import mixins as ec2_mixins

license_specification_property = ec2_mixins.CfnInstancePropsMixin.LicenseSpecificationProperty(
    license_configuration_arn="licenseConfigurationArn"
)

Attributes

license_configuration_arn

The Amazon Resource Name (ARN) of the license configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-licensespecification.html#cfn-ec2-instance-licensespecification-licenseconfigurationarn

MetadataOptionsProperty

class CfnInstancePropsMixin.MetadataOptionsProperty(*, http_endpoint=None, http_protocol_ipv6=None, http_put_response_hop_limit=None, http_tokens=None, instance_metadata_tags=None)

Bases: object

Specifies the metadata options for the instance.

Parameters:
  • http_endpoint (Optional[str]) – Enables or disables the HTTP metadata endpoint on your instances. If you specify a value of disabled , you cannot access your instance metadata. Default: enabled

  • http_protocol_ipv6 (Optional[str]) – Enables or disables the IPv6 endpoint for the instance metadata service. Default: disabled

  • http_put_response_hop_limit (Union[int, float, None]) – The maximum number of hops that the metadata token can travel. Possible values: Integers from 1 to 64 Default: - 1

  • http_tokens (Optional[str]) – Indicates whether IMDSv2 is required. - optional - IMDSv2 is optional, which means that you can use either IMDSv2 or IMDSv1. - required - IMDSv2 is required, which means that IMDSv1 is disabled, and you must use IMDSv2. Default: - If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0 and the account level default is set to no-preference , the default is required . - If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0 , but the account level default is set to V1 or V2 , the default is optional . The default value can also be affected by other combinations of parameters. For more information, see Order of precedence for instance metadata options in the Amazon EC2 User Guide .

  • instance_metadata_tags (Optional[str]) – Set to enabled to allow access to instance tags from the instance metadata. Set to disabled to turn off access to instance tags from the instance metadata. For more information, see Work with instance tags using the instance metadata . Default: disabled

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-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_ec2 import mixins as ec2_mixins

metadata_options_property = ec2_mixins.CfnInstancePropsMixin.MetadataOptionsProperty(
    http_endpoint="httpEndpoint",
    http_protocol_ipv6="httpProtocolIpv6",
    http_put_response_hop_limit=123,
    http_tokens="httpTokens",
    instance_metadata_tags="instanceMetadataTags"
)

Attributes

http_endpoint

Enables or disables the HTTP metadata endpoint on your instances.

If you specify a value of disabled , you cannot access your instance metadata.

Default: enabled

See:

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

http_protocol_ipv6

Enables or disables the IPv6 endpoint for the instance metadata service.

Default: disabled

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-metadataoptions.html#cfn-ec2-instance-metadataoptions-httpprotocolipv6

http_put_response_hop_limit

The maximum number of hops that the metadata token can travel.

Possible values: Integers from 1 to 64

Default:
  • 1

See:

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

http_tokens

Indicates whether IMDSv2 is required.

  • optional - IMDSv2 is optional, which means that you can use either IMDSv2 or IMDSv1.

  • required - IMDSv2 is required, which means that IMDSv1 is disabled, and you must use IMDSv2.

Default:

  • If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0 and the account level default is set to no-preference , the default is required .

  • If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0 , but the account level default is set to V1 or V2 , the default is optional .

The default value can also be affected by other combinations of parameters. For more information, see Order of precedence for instance metadata options in the Amazon EC2 User Guide .

See:

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

instance_metadata_tags

Set to enabled to allow access to instance tags from the instance metadata.

Set to disabled to turn off access to instance tags from the instance metadata. For more information, see Work with instance tags using the instance metadata .

Default: disabled

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-metadataoptions.html#cfn-ec2-instance-metadataoptions-instancemetadatatags

NetworkInterfaceProperty

class CfnInstancePropsMixin.NetworkInterfaceProperty(*, associate_carrier_ip_address=None, associate_public_ip_address=None, delete_on_termination=None, description=None, device_index=None, ena_srd_specification=None, group_set=None, ipv6_address_count=None, ipv6_addresses=None, network_interface_id=None, private_ip_address=None, private_ip_addresses=None, secondary_private_ip_address_count=None, subnet_id=None)

Bases: object

Specifies a network interface that is to be attached to an instance.

You can create a network interface when launching an instance. For an example, see the AWS::EC2::Instance examples .

Alternatively, you can attach an existing network interface when launching an instance. For an example, see the AWS::EC2:NetworkInterface examples .

Parameters:
  • associate_carrier_ip_address (Union[bool, IResolvable, None]) – Indicates whether to assign a carrier IP address to the network interface. You can only assign a carrier IP address to a network interface that is in a subnet in a Wavelength Zone. For more information about carrier IP addresses, see Carrier IP address in the AWS Wavelength Developer Guide .

  • associate_public_ip_address (Union[bool, IResolvable, None]) – Indicates whether to assign a public IPv4 address to an instance. Applies only if creating a network interface when launching an instance. The network interface must be the primary network interface. If launching into a default subnet, the default value is true . AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the VPC pricing page .

  • delete_on_termination (Union[bool, IResolvable, None]) – Indicates whether the network interface is deleted when the instance is terminated. Applies only if creating a network interface when launching an instance.

  • description (Optional[str]) – The description of the network interface. Applies only if creating a network interface when launching an instance.

  • device_index (Optional[str]) – The position of the network interface in the attachment order. A primary network interface has a device index of 0. If you create a network interface when launching an instance, you must specify the device index.

  • ena_srd_specification (Union[IResolvable, EnaSrdSpecificationProperty, Dict[str, Any], None]) – Configures ENA Express for UDP network traffic.

  • group_set (Optional[Sequence[str]]) – The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.

  • ipv6_address_count (Union[int, float, None]) – A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you’ve specified a minimum number of instances to launch.

  • ipv6_addresses (Union[IResolvable, Sequence[Union[IResolvable, InstanceIpv6AddressProperty, Dict[str, Any]]], None]) – The IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you’ve specified a minimum number of instances to launch.

  • network_interface_id (Optional[str]) – The ID of the network interface, when attaching an existing network interface.

  • private_ip_address (Optional[str]) – The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance.

  • private_ip_addresses (Union[IResolvable, Sequence[Union[IResolvable, PrivateIpAddressSpecificationProperty, Dict[str, Any]]], None]) – One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary.

  • secondary_private_ip_address_count (Union[int, float, None]) – The number of secondary private IPv4 addresses. You can’t specify this option and specify more than one private IP address using the private IP addresses option.

  • subnet_id (Optional[str]) – The ID of the subnet associated with the network interface.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.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_ec2 import mixins as ec2_mixins

network_interface_property = ec2_mixins.CfnInstancePropsMixin.NetworkInterfaceProperty(
    associate_carrier_ip_address=False,
    associate_public_ip_address=False,
    delete_on_termination=False,
    description="description",
    device_index="deviceIndex",
    ena_srd_specification=ec2_mixins.CfnInstancePropsMixin.EnaSrdSpecificationProperty(
        ena_srd_enabled=False,
        ena_srd_udp_specification=ec2_mixins.CfnInstancePropsMixin.EnaSrdUdpSpecificationProperty(
            ena_srd_udp_enabled=False
        )
    ),
    group_set=["groupSet"],
    ipv6_address_count=123,
    ipv6_addresses=[ec2_mixins.CfnInstancePropsMixin.InstanceIpv6AddressProperty(
        ipv6_address="ipv6Address"
    )],
    network_interface_id="networkInterfaceId",
    private_ip_address="privateIpAddress",
    private_ip_addresses=[ec2_mixins.CfnInstancePropsMixin.PrivateIpAddressSpecificationProperty(
        primary=False,
        private_ip_address="privateIpAddress"
    )],
    secondary_private_ip_address_count=123,
    subnet_id="subnetId"
)

Attributes

associate_carrier_ip_address

Indicates whether to assign a carrier IP address to the network interface.

You can only assign a carrier IP address to a network interface that is in a subnet in a Wavelength Zone. For more information about carrier IP addresses, see Carrier IP address in the AWS Wavelength Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-associatecarrieripaddress

associate_public_ip_address

Indicates whether to assign a public IPv4 address to an instance.

Applies only if creating a network interface when launching an instance. The network interface must be the primary network interface. If launching into a default subnet, the default value is true .

AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the VPC pricing page .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-associatepublicipaddress

delete_on_termination

Indicates whether the network interface is deleted when the instance is terminated.

Applies only if creating a network interface when launching an instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-deleteontermination

description

The description of the network interface.

Applies only if creating a network interface when launching an instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-description

device_index

The position of the network interface in the attachment order.

A primary network interface has a device index of 0.

If you create a network interface when launching an instance, you must specify the device index.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-deviceindex

ena_srd_specification

Configures ENA Express for UDP network traffic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-enasrdspecification

group_set

The IDs of the security groups for the network interface.

Applies only if creating a network interface when launching an instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-groupset

ipv6_address_count

A number of IPv6 addresses to assign to the network interface.

Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you’ve specified a minimum number of instances to launch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-ipv6addresscount

ipv6_addresses

The IPv6 addresses to assign to the network interface.

You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you’ve specified a minimum number of instances to launch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-ipv6addresses

network_interface_id

The ID of the network interface, when attaching an existing network interface.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-networkinterfaceid

private_ip_address

The private IPv4 address of the network interface.

Applies only if creating a network interface when launching an instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-privateipaddress

private_ip_addresses

One or more private IPv4 addresses to assign to the network interface.

Only one private IPv4 address can be designated as primary.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-privateipaddresses

secondary_private_ip_address_count

The number of secondary private IPv4 addresses.

You can’t specify this option and specify more than one private IP address using the private IP addresses option.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-secondaryprivateipaddresscount

subnet_id

The ID of the subnet associated with the network interface.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-networkinterface.html#cfn-ec2-instance-networkinterface-subnetid

NoDeviceProperty

class CfnInstancePropsMixin.NoDeviceProperty

Bases: object

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-nodevice.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_ec2 import mixins as ec2_mixins

no_device_property = ec2_mixins.CfnInstancePropsMixin.NoDeviceProperty()

PrivateDnsNameOptionsProperty

class CfnInstancePropsMixin.PrivateDnsNameOptionsProperty(*, enable_resource_name_dns_aaaa_record=None, enable_resource_name_dns_a_record=None, hostname_type=None)

Bases: object

The type of hostnames to assign to instances in the subnet at launch.

For IPv4 only subnets, an instance DNS name must be based on the instance IPv4 address. For IPv6 only subnets, an instance DNS name must be based on the instance ID. For dual-stack subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .

Parameters:
  • enable_resource_name_dns_aaaa_record (Union[bool, IResolvable, None]) –

    Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .

  • enable_resource_name_dns_a_record (Union[bool, IResolvable, None]) –

    Indicates whether to respond to DNS queries for instance hostnames with DNS A records. For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .

  • hostname_type (Optional[str]) –

    The type of hostnames to assign to instances in the subnet at launch. For IPv4 only subnets, an instance DNS name must be based on the instance IPv4 address. For IPv6 only subnets, an instance DNS name must be based on the instance ID. For dual-stack subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-privatednsnameoptions.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_ec2 import mixins as ec2_mixins

private_dns_name_options_property = ec2_mixins.CfnInstancePropsMixin.PrivateDnsNameOptionsProperty(
    enable_resource_name_dns_aaaa_record=False,
    enable_resource_name_dns_aRecord=False,
    hostname_type="hostnameType"
)

Attributes

enable_resource_name_dns_a_record

Indicates whether to respond to DNS queries for instance hostnames with DNS A records.

For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-privatednsnameoptions.html#cfn-ec2-instance-privatednsnameoptions-enableresourcenamednsarecord

enable_resource_name_dns_aaaa_record

Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.

For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-privatednsnameoptions.html#cfn-ec2-instance-privatednsnameoptions-enableresourcenamednsaaaarecord

hostname_type

The type of hostnames to assign to instances in the subnet at launch.

For IPv4 only subnets, an instance DNS name must be based on the instance IPv4 address. For IPv6 only subnets, an instance DNS name must be based on the instance ID. For dual-stack subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-privatednsnameoptions.html#cfn-ec2-instance-privatednsnameoptions-hostnametype

PrivateIpAddressSpecificationProperty

class CfnInstancePropsMixin.PrivateIpAddressSpecificationProperty(*, primary=None, private_ip_address=None)

Bases: object

Specifies a secondary private IPv4 address for a network interface.

Parameters:
  • primary (Union[bool, IResolvable, None]) – Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.

  • private_ip_address (Optional[str]) – The private IPv4 address.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-privateipaddressspecification.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_ec2 import mixins as ec2_mixins

private_ip_address_specification_property = ec2_mixins.CfnInstancePropsMixin.PrivateIpAddressSpecificationProperty(
    primary=False,
    private_ip_address="privateIpAddress"
)

Attributes

primary

Indicates whether the private IPv4 address is the primary private IPv4 address.

Only one IPv4 address can be designated as primary.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-privateipaddressspecification.html#cfn-ec2-instance-privateipaddressspecification-primary

private_ip_address

The private IPv4 address.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-privateipaddressspecification.html#cfn-ec2-instance-privateipaddressspecification-privateipaddress

SsmAssociationProperty

class CfnInstancePropsMixin.SsmAssociationProperty(*, association_parameters=None, document_name=None)

Bases: object

Specifies the SSM document and parameter values in AWS Systems Manager to associate with an instance.

SsmAssociations is a property of the AWS::EC2::Instance resource.

Parameters:
  • association_parameters (Union[IResolvable, Sequence[Union[IResolvable, AssociationParameterProperty, Dict[str, Any]]], None]) – The input parameter values to use with the associated SSM document.

  • document_name (Optional[str]) – The name of an SSM document to associate with the instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-ssmassociation.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_ec2 import mixins as ec2_mixins

ssm_association_property = ec2_mixins.CfnInstancePropsMixin.SsmAssociationProperty(
    association_parameters=[ec2_mixins.CfnInstancePropsMixin.AssociationParameterProperty(
        key="key",
        value=["value"]
    )],
    document_name="documentName"
)

Attributes

association_parameters

The input parameter values to use with the associated SSM document.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-ssmassociation.html#cfn-ec2-instance-ssmassociation-associationparameters

document_name

The name of an SSM document to associate with the instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-ssmassociation.html#cfn-ec2-instance-ssmassociation-documentname

StateProperty

class CfnInstancePropsMixin.StateProperty(*, code=None, name=None)

Bases: object

Describes the current state of an instance.

Parameters:
  • code (Optional[str]) – The state of the instance as a 16-bit unsigned integer. The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored. The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255. The valid values for instance-state-code will all be in the range of the low byte and they are: - 0 : pending - 16 : running - 32 : shutting-down - 48 : terminated - 64 : stopping - 80 : stopped You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.

  • name (Optional[str]) – The current state of the instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-state.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_ec2 import mixins as ec2_mixins

state_property = ec2_mixins.CfnInstancePropsMixin.StateProperty(
    code="code",
    name="name"
)

Attributes

code

The state of the instance as a 16-bit unsigned integer.

The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.

The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.

The valid values for instance-state-code will all be in the range of the low byte and they are:

  • 0 : pending

  • 16 : running

  • 32 : shutting-down

  • 48 : terminated

  • 64 : stopping

  • 80 : stopped

You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-state.html#cfn-ec2-instance-state-code

name

The current state of the instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-state.html#cfn-ec2-instance-state-name

VolumeProperty

class CfnInstancePropsMixin.VolumeProperty(*, device=None, volume_id=None)

Bases: object

Specifies a volume to attach to an instance.

Volume is an embedded property of the AWS::EC2::Instance resource.

Parameters:
  • device (Optional[str]) – The device name (for example, /dev/sdh or xvdh ).

  • volume_id (Optional[str]) – The ID of the EBS volume. The volume and instance must be within the same Availability Zone.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-volume.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_ec2 import mixins as ec2_mixins

volume_property = ec2_mixins.CfnInstancePropsMixin.VolumeProperty(
    device="device",
    volume_id="volumeId"
)

Attributes

device

The device name (for example, /dev/sdh or xvdh ).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-volume.html#cfn-ec2-instance-volume-device

volume_id

The ID of the EBS volume.

The volume and instance must be within the same Availability Zone.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-volume.html#cfn-ec2-instance-volume-volumeid