CfnInstanceProps

class aws_cdk.aws_ec2.CfnInstanceProps(*, additional_info=None, affinity=None, availability_zone=None, block_device_mappings=None, cpu_options=None, credit_specification=None, disable_api_termination=None, ebs_optimized=None, elastic_gpu_specifications=None, elastic_inference_accelerators=None, enclave_options=None, hibernation_options=None, host_id=None, host_resource_group_arn=None, iam_instance_profile=None, image_id=None, instance_initiated_shutdown_behavior=None, instance_type=None, ipv6_address_count=None, ipv6_addresses=None, kernel_id=None, key_name=None, launch_template=None, license_specifications=None, monitoring=None, network_interfaces=None, placement_group_name=None, private_ip_address=None, ramdisk_id=None, security_group_ids=None, security_groups=None, source_dest_check=None, ssm_associations=None, subnet_id=None, tags=None, tenancy=None, user_data=None, volumes=None)

Bases: object

Properties for defining a AWS::EC2::Instance.

Parameters
  • additional_info (Optional[str]) – AWS::EC2::Instance.AdditionalInfo.

  • affinity (Optional[str]) – AWS::EC2::Instance.Affinity.

  • availability_zone (Optional[str]) – AWS::EC2::Instance.AvailabilityZone.

  • block_device_mappings (Union[IResolvable, Sequence[Union[IResolvable, BlockDeviceMappingProperty]], None]) – AWS::EC2::Instance.BlockDeviceMappings.

  • cpu_options (Union[IResolvable, CpuOptionsProperty, None]) – AWS::EC2::Instance.CpuOptions.

  • credit_specification (Union[IResolvable, CreditSpecificationProperty, None]) – AWS::EC2::Instance.CreditSpecification.

  • disable_api_termination (Union[bool, IResolvable, None]) – AWS::EC2::Instance.DisableApiTermination.

  • ebs_optimized (Union[bool, IResolvable, None]) – AWS::EC2::Instance.EbsOptimized.

  • elastic_gpu_specifications (Union[IResolvable, Sequence[Union[IResolvable, ElasticGpuSpecificationProperty]], None]) – AWS::EC2::Instance.ElasticGpuSpecifications.

  • elastic_inference_accelerators (Union[IResolvable, Sequence[Union[IResolvable, ElasticInferenceAcceleratorProperty]], None]) – AWS::EC2::Instance.ElasticInferenceAccelerators.

  • enclave_options (Union[IResolvable, EnclaveOptionsProperty, None]) – AWS::EC2::Instance.EnclaveOptions.

  • hibernation_options (Union[IResolvable, HibernationOptionsProperty, None]) – AWS::EC2::Instance.HibernationOptions.

  • host_id (Optional[str]) – AWS::EC2::Instance.HostId.

  • host_resource_group_arn (Optional[str]) – AWS::EC2::Instance.HostResourceGroupArn.

  • iam_instance_profile (Optional[str]) – AWS::EC2::Instance.IamInstanceProfile.

  • image_id (Optional[str]) – AWS::EC2::Instance.ImageId.

  • instance_initiated_shutdown_behavior (Optional[str]) – AWS::EC2::Instance.InstanceInitiatedShutdownBehavior.

  • instance_type (Optional[str]) – AWS::EC2::Instance.InstanceType.

  • ipv6_address_count (Union[int, float, None]) – AWS::EC2::Instance.Ipv6AddressCount.

  • ipv6_addresses (Union[IResolvable, Sequence[Union[IResolvable, InstanceIpv6AddressProperty]], None]) – AWS::EC2::Instance.Ipv6Addresses.

  • kernel_id (Optional[str]) – AWS::EC2::Instance.KernelId.

  • key_name (Optional[str]) – AWS::EC2::Instance.KeyName.

  • launch_template (Union[IResolvable, LaunchTemplateSpecificationProperty, None]) – AWS::EC2::Instance.LaunchTemplate.

  • license_specifications (Union[IResolvable, Sequence[Union[IResolvable, LicenseSpecificationProperty]], None]) – AWS::EC2::Instance.LicenseSpecifications.

  • monitoring (Union[bool, IResolvable, None]) – AWS::EC2::Instance.Monitoring.

  • network_interfaces (Union[IResolvable, Sequence[Union[IResolvable, NetworkInterfaceProperty]], None]) – AWS::EC2::Instance.NetworkInterfaces.

  • placement_group_name (Optional[str]) – AWS::EC2::Instance.PlacementGroupName.

  • private_ip_address (Optional[str]) – AWS::EC2::Instance.PrivateIpAddress.

  • ramdisk_id (Optional[str]) – AWS::EC2::Instance.RamdiskId.

  • security_group_ids (Optional[Sequence[str]]) – AWS::EC2::Instance.SecurityGroupIds.

  • security_groups (Optional[Sequence[str]]) – AWS::EC2::Instance.SecurityGroups.

  • source_dest_check (Union[bool, IResolvable, None]) – AWS::EC2::Instance.SourceDestCheck.

  • ssm_associations (Union[IResolvable, Sequence[Union[IResolvable, SsmAssociationProperty]], None]) – AWS::EC2::Instance.SsmAssociations.

  • subnet_id (Optional[str]) – AWS::EC2::Instance.SubnetId.

  • tags (Optional[Sequence[CfnTag]]) – AWS::EC2::Instance.Tags.

  • tenancy (Optional[str]) – AWS::EC2::Instance.Tenancy.

  • user_data (Optional[str]) – AWS::EC2::Instance.UserData.

  • volumes (Union[IResolvable, Sequence[Union[IResolvable, VolumeProperty]], None]) – AWS::EC2::Instance.Volumes.

Link

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

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ec2 as ec2

cfn_instance_props = ec2.CfnInstanceProps(
    additional_info="additionalInfo",
    affinity="affinity",
    availability_zone="availabilityZone",
    block_device_mappings=[ec2.CfnInstance.BlockDeviceMappingProperty(
        device_name="deviceName",

        # the properties below are optional
        ebs=ec2.CfnInstance.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.CfnInstance.NoDeviceProperty(),
        virtual_name="virtualName"
    )],
    cpu_options=ec2.CfnInstance.CpuOptionsProperty(
        core_count=123,
        threads_per_core=123
    ),
    credit_specification=ec2.CfnInstance.CreditSpecificationProperty(
        cpu_credits="cpuCredits"
    ),
    disable_api_termination=False,
    ebs_optimized=False,
    elastic_gpu_specifications=[ec2.CfnInstance.ElasticGpuSpecificationProperty(
        type="type"
    )],
    elastic_inference_accelerators=[ec2.CfnInstance.ElasticInferenceAcceleratorProperty(
        type="type",

        # the properties below are optional
        count=123
    )],
    enclave_options=ec2.CfnInstance.EnclaveOptionsProperty(
        enabled=False
    ),
    hibernation_options=ec2.CfnInstance.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.CfnInstance.InstanceIpv6AddressProperty(
        ipv6_address="ipv6Address"
    )],
    kernel_id="kernelId",
    key_name="keyName",
    launch_template=ec2.CfnInstance.LaunchTemplateSpecificationProperty(
        version="version",

        # the properties below are optional
        launch_template_id="launchTemplateId",
        launch_template_name="launchTemplateName"
    ),
    license_specifications=[ec2.CfnInstance.LicenseSpecificationProperty(
        license_configuration_arn="licenseConfigurationArn"
    )],
    monitoring=False,
    network_interfaces=[ec2.CfnInstance.NetworkInterfaceProperty(
        device_index="deviceIndex",

        # the properties below are optional
        associate_public_ip_address=False,
        delete_on_termination=False,
        description="description",
        group_set=["groupSet"],
        ipv6_address_count=123,
        ipv6_addresses=[ec2.CfnInstance.InstanceIpv6AddressProperty(
            ipv6_address="ipv6Address"
        )],
        network_interface_id="networkInterfaceId",
        private_ip_address="privateIpAddress",
        private_ip_addresses=[ec2.CfnInstance.PrivateIpAddressSpecificationProperty(
            primary=False,
            private_ip_address="privateIpAddress"
        )],
        secondary_private_ip_address_count=123,
        subnet_id="subnetId"
    )],
    placement_group_name="placementGroupName",
    private_ip_address="privateIpAddress",
    ramdisk_id="ramdiskId",
    security_group_ids=["securityGroupIds"],
    security_groups=["securityGroups"],
    source_dest_check=False,
    ssm_associations=[ec2.CfnInstance.SsmAssociationProperty(
        document_name="documentName",

        # the properties below are optional
        association_parameters=[ec2.CfnInstance.AssociationParameterProperty(
            key="key",
            value=["value"]
        )]
    )],
    subnet_id="subnetId",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    tenancy="tenancy",
    user_data="userData",
    volumes=[ec2.CfnInstance.VolumeProperty(
        device="device",
        volume_id="volumeId"
    )]
)

Attributes

additional_info

AWS::EC2::Instance.AdditionalInfo.

Link

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

Return type

Optional[str]

affinity

AWS::EC2::Instance.Affinity.

Link

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

Return type

Optional[str]

availability_zone

AWS::EC2::Instance.AvailabilityZone.

Link

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

Return type

Optional[str]

block_device_mappings

AWS::EC2::Instance.BlockDeviceMappings.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, BlockDeviceMappingProperty]], None]

cpu_options

AWS::EC2::Instance.CpuOptions.

Link

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

Return type

Union[IResolvable, CpuOptionsProperty, None]

credit_specification

AWS::EC2::Instance.CreditSpecification.

Link

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

Return type

Union[IResolvable, CreditSpecificationProperty, None]

disable_api_termination

AWS::EC2::Instance.DisableApiTermination.

Link

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

Return type

Union[bool, IResolvable, None]

ebs_optimized

AWS::EC2::Instance.EbsOptimized.

Link

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

Return type

Union[bool, IResolvable, None]

elastic_gpu_specifications

AWS::EC2::Instance.ElasticGpuSpecifications.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, ElasticGpuSpecificationProperty]], None]

elastic_inference_accelerators

AWS::EC2::Instance.ElasticInferenceAccelerators.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, ElasticInferenceAcceleratorProperty]], None]

enclave_options

AWS::EC2::Instance.EnclaveOptions.

Link

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

Return type

Union[IResolvable, EnclaveOptionsProperty, None]

hibernation_options

AWS::EC2::Instance.HibernationOptions.

Link

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

Return type

Union[IResolvable, HibernationOptionsProperty, None]

host_id

AWS::EC2::Instance.HostId.

Link

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

Return type

Optional[str]

host_resource_group_arn

AWS::EC2::Instance.HostResourceGroupArn.

Link

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

Return type

Optional[str]

iam_instance_profile

AWS::EC2::Instance.IamInstanceProfile.

Link

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

Return type

Optional[str]

image_id

AWS::EC2::Instance.ImageId.

Link

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

Return type

Optional[str]

instance_initiated_shutdown_behavior

AWS::EC2::Instance.InstanceInitiatedShutdownBehavior.

Link

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

Return type

Optional[str]

instance_type

AWS::EC2::Instance.InstanceType.

Link

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

Return type

Optional[str]

ipv6_address_count

AWS::EC2::Instance.Ipv6AddressCount.

Link

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

Return type

Union[int, float, None]

ipv6_addresses

AWS::EC2::Instance.Ipv6Addresses.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, InstanceIpv6AddressProperty]], None]

kernel_id

AWS::EC2::Instance.KernelId.

Link

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

Return type

Optional[str]

key_name

AWS::EC2::Instance.KeyName.

Link

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

Return type

Optional[str]

launch_template

AWS::EC2::Instance.LaunchTemplate.

Link

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

Return type

Union[IResolvable, LaunchTemplateSpecificationProperty, None]

license_specifications

AWS::EC2::Instance.LicenseSpecifications.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, LicenseSpecificationProperty]], None]

monitoring

AWS::EC2::Instance.Monitoring.

Link

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

Return type

Union[bool, IResolvable, None]

network_interfaces

AWS::EC2::Instance.NetworkInterfaces.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, NetworkInterfaceProperty]], None]

placement_group_name

AWS::EC2::Instance.PlacementGroupName.

Link

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

Return type

Optional[str]

private_ip_address

AWS::EC2::Instance.PrivateIpAddress.

Link

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

Return type

Optional[str]

ramdisk_id

AWS::EC2::Instance.RamdiskId.

Link

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

Return type

Optional[str]

security_group_ids

AWS::EC2::Instance.SecurityGroupIds.

Link

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

Return type

Optional[List[str]]

security_groups

AWS::EC2::Instance.SecurityGroups.

Link

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

Return type

Optional[List[str]]

source_dest_check

AWS::EC2::Instance.SourceDestCheck.

Link

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

Return type

Union[bool, IResolvable, None]

ssm_associations

AWS::EC2::Instance.SsmAssociations.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, SsmAssociationProperty]], None]

subnet_id

AWS::EC2::Instance.SubnetId.

Link

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

Return type

Optional[str]

tags

AWS::EC2::Instance.Tags.

Link

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

Return type

Optional[List[CfnTag]]

tenancy

AWS::EC2::Instance.Tenancy.

Link

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

Return type

Optional[str]

user_data

AWS::EC2::Instance.UserData.

Link

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

Return type

Optional[str]

volumes

AWS::EC2::Instance.Volumes.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, VolumeProperty]], None]