CfnLaunchTemplate

class aws_cdk.aws_ec2.CfnLaunchTemplate(scope, id, *, launch_template_data, launch_template_name=None, tag_specifications=None, version_description=None)

Bases: CfnResource

A CloudFormation AWS::EC2::LaunchTemplate.

Specifies the properties for creating a launch template.

The minimum required properties for specifying a launch template are as follows:

  • You must specify at least one property for the launch template data.

  • You do not need to specify a name for the launch template. If you do not specify a name, AWS CloudFormation creates the name for you.

A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

CloudformationResource

AWS::EC2::LaunchTemplate

Link

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

ExampleMetadata

infused

Example:

# cluster: eks.Cluster


user_data = """MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="==MYBOUNDARY=="

--==MYBOUNDARY==
Content-Type: text/x-shellscript; charset="us-ascii"

#!/bin/bash
echo "Running custom user data script"

--==MYBOUNDARY==--\
"""
lt = ec2.CfnLaunchTemplate(self, "LaunchTemplate",
    launch_template_data=ec2.CfnLaunchTemplate.LaunchTemplateDataProperty(
        instance_type="t3.small",
        user_data=Fn.base64(user_data)
    )
)

cluster.add_nodegroup_capacity("extra-ng",
    launch_template_spec=eks.LaunchTemplateSpec(
        id=lt.ref,
        version=lt.attr_latest_version_number
    )
)

Create a new AWS::EC2::LaunchTemplate.

Parameters
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • launch_template_data (Union[IResolvable, LaunchTemplateDataProperty, Dict[str, Any]]) – The information for the launch template.

  • launch_template_name (Optional[str]) – A name for the launch template.

  • tag_specifications (Union[IResolvable, Sequence[Union[IResolvable, LaunchTemplateTagSpecificationProperty, Dict[str, Any]]], None]) – The tags to apply to the launch template on creation. To tag the launch template, the resource type must be launch-template . .. epigraph:: To specify the tags for the resources that are created when an instance is launched, you must use the TagSpecifications parameter in the launch template data structure.

  • version_description (Optional[str]) – A description for the first version of the launch template.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters

path (str) – The path of the value to delete.

Return type

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters

target (CfnResource) –

Return type

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters
  • key (str) –

  • value (Any) –

See

Return type

None

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters

property_path (str) – The path to the property.

Return type

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters

attribute_name (str) – The name of the attribute.

Return type

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters

key (str) –

See

Return type

Any

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters

new_logical_id (str) – The new logical ID to use for this stack element.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Returns

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::EC2::LaunchTemplate'
attr_default_version_number

The default version of the launch template, such as 2.

The default version of a launch template cannot be specified in AWS CloudFormation . The default version can be set in the Amazon EC2 console or by using the modify-launch-template AWS CLI command.

CloudformationAttribute

DefaultVersionNumber

attr_latest_version_number

The latest version of the launch template, such as 5 .

CloudformationAttribute

LatestVersionNumber

cfn_options

Options for this resource, such as condition, update policy etc.

cfn_resource_type

AWS resource type.

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

launch_template_data

The information for the launch template.

Link

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

launch_template_name

A name for the launch template.

Link

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

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Returns

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The construct tree node associated with this construct.

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

tag_specifications

The tags to apply to the launch template on creation.

To tag the launch template, the resource type must be launch-template . .. epigraph:

To specify the tags for the resources that are created when an instance is launched, you must use the ``TagSpecifications`` parameter in the `launch template data <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestLaunchTemplateData.html>`_ structure.
Link

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

version_description

A description for the first version of the launch template.

Link

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

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters

x (Any) –

Return type

bool

Returns

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters

construct (IConstruct) –

Return type

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

AcceleratorCountProperty

class CfnLaunchTemplate.AcceleratorCountProperty(*, max=None, min=None)

Bases: object

The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance.

Parameters
  • max (Union[int, float, None]) – The maximum number of accelerators. To specify no maximum limit, omit this parameter. To exclude accelerator-enabled instance types, set Max to 0 .

  • min (Union[int, float, None]) – The minimum number of accelerators. To specify no minimum limit, omit this parameter.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

accelerator_count_property = ec2.CfnLaunchTemplate.AcceleratorCountProperty(
    max=123,
    min=123
)

Attributes

max

The maximum number of accelerators.

To specify no maximum limit, omit this parameter. To exclude accelerator-enabled instance types, set Max to 0 .

Link

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

min

The minimum number of accelerators.

To specify no minimum limit, omit this parameter.

Link

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

AcceleratorTotalMemoryMiBProperty

class CfnLaunchTemplate.AcceleratorTotalMemoryMiBProperty(*, max=None, min=None)

Bases: object

The minimum and maximum amount of total accelerator memory, in MiB.

Parameters
  • max (Union[int, float, None]) – The maximum amount of accelerator memory, in MiB. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum amount of accelerator memory, in MiB. To specify no minimum limit, omit this parameter.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

accelerator_total_memory_mi_bProperty = ec2.CfnLaunchTemplate.AcceleratorTotalMemoryMiBProperty(
    max=123,
    min=123
)

Attributes

max

The maximum amount of accelerator memory, in MiB.

To specify no maximum limit, omit this parameter.

Link

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

min

The minimum amount of accelerator memory, in MiB.

To specify no minimum limit, omit this parameter.

Link

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

BaselineEbsBandwidthMbpsProperty

class CfnLaunchTemplate.BaselineEbsBandwidthMbpsProperty(*, max=None, min=None)

Bases: object

The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps.

For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide .

Parameters
  • max (Union[int, float, None]) – The maximum baseline bandwidth, in Mbps. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum baseline bandwidth, in Mbps. To specify no minimum limit, omit this parameter.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

baseline_ebs_bandwidth_mbps_property = ec2.CfnLaunchTemplate.BaselineEbsBandwidthMbpsProperty(
    max=123,
    min=123
)

Attributes

max

The maximum baseline bandwidth, in Mbps.

To specify no maximum limit, omit this parameter.

Link

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

min

The minimum baseline bandwidth, in Mbps.

To specify no minimum limit, omit this parameter.

Link

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

BlockDeviceMappingProperty

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

Bases: object

Information about a block device mapping for an Amazon EC2 launch template.

BlockDeviceMapping is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

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

  • ebs (Union[IResolvable, EbsProperty, Dict[str, Any], None]) – Parameters used to automatically set up EBS volumes when the instance is launched.

  • no_device (Optional[str]) – To omit the device from the block device mapping, specify an empty string.

  • virtual_name (Optional[str]) – The virtual device name (ephemeralN). Instance store volumes are numbered starting from 0. 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.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-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.
import aws_cdk.aws_ec2 as ec2

block_device_mapping_property = ec2.CfnLaunchTemplate.BlockDeviceMappingProperty(
    device_name="deviceName",
    ebs=ec2.CfnLaunchTemplate.EbsProperty(
        delete_on_termination=False,
        encrypted=False,
        iops=123,
        kms_key_id="kmsKeyId",
        snapshot_id="snapshotId",
        throughput=123,
        volume_size=123,
        volume_type="volumeType"
    ),
    no_device="noDevice",
    virtual_name="virtualName"
)

Attributes

device_name

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

Link

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

ebs

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

Link

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

no_device

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

Link

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

virtual_name

The virtual device name (ephemeralN).

Instance store volumes are numbered starting from 0. 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.

Link

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

CapacityReservationSpecificationProperty

class CfnLaunchTemplate.CapacityReservationSpecificationProperty(*, capacity_reservation_preference=None, capacity_reservation_target=None)

Bases: object

Specifies an instance’s Capacity Reservation targeting option. You can specify only one option at a time.

CapacityReservationSpecification is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters
  • capacity_reservation_preference (Optional[str]) – Indicates the instance’s Capacity Reservation preferences. Possible preferences include:. - open - The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone). - none - The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.

  • capacity_reservation_target (Union[IResolvable, CapacityReservationTargetProperty, Dict[str, Any], None]) – Information about the target Capacity Reservation or Capacity Reservation group.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-capacityreservationspecification.html

ExampleMetadata

fixture=_generated

Example:

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

capacity_reservation_specification_property = ec2.CfnLaunchTemplate.CapacityReservationSpecificationProperty(
    capacity_reservation_preference="capacityReservationPreference",
    capacity_reservation_target=ec2.CfnLaunchTemplate.CapacityReservationTargetProperty(
        capacity_reservation_id="capacityReservationId",
        capacity_reservation_resource_group_arn="capacityReservationResourceGroupArn"
    )
)

Attributes

capacity_reservation_preference

.

  • open - The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).

  • none - The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.

Link

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

Type

Indicates the instance’s Capacity Reservation preferences. Possible preferences include

capacity_reservation_target

Information about the target Capacity Reservation or Capacity Reservation group.

Link

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

CapacityReservationTargetProperty

class CfnLaunchTemplate.CapacityReservationTargetProperty(*, capacity_reservation_id=None, capacity_reservation_resource_group_arn=None)

Bases: object

Specifies a target Capacity Reservation.

CapacityReservationTarget is a property of the Amazon EC2 LaunchTemplate LaunchTemplateData property type.

Parameters
  • capacity_reservation_id (Optional[str]) – The ID of the Capacity Reservation in which to run the instance.

  • capacity_reservation_resource_group_arn (Optional[str]) – The ARN of the Capacity Reservation resource group in which to run the instance.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

capacity_reservation_target_property = ec2.CfnLaunchTemplate.CapacityReservationTargetProperty(
    capacity_reservation_id="capacityReservationId",
    capacity_reservation_resource_group_arn="capacityReservationResourceGroupArn"
)

Attributes

capacity_reservation_id

The ID of the Capacity Reservation in which to run the instance.

Link

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

capacity_reservation_resource_group_arn

The ARN of the Capacity Reservation resource group in which to run the instance.

Link

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

CpuOptionsProperty

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

Bases: object

Specifies the CPU options for an instance.

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

CpuOptions is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

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. To disable multithreading for the instance, specify a value of 1 . Otherwise, specify the default value of 2 .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-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.
import aws_cdk.aws_ec2 as ec2

cpu_options_property = ec2.CfnLaunchTemplate.CpuOptionsProperty(
    core_count=123,
    threads_per_core=123
)

Attributes

core_count

The number of CPU cores for the instance.

Link

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

threads_per_core

The number of threads per CPU core.

To disable multithreading for the instance, specify a value of 1 . Otherwise, specify the default value of 2 .

Link

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

CreditSpecificationProperty

class CfnLaunchTemplate.CreditSpecificationProperty(*, cpu_credits=None)

Bases: object

Specifies the credit option for CPU usage of a T2, T3, or T3a instance.

CreditSpecification is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters

cpu_credits (Optional[str]) – The credit option for CPU usage of a T instance. Valid values: standard | unlimited

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-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.
import aws_cdk.aws_ec2 as ec2

credit_specification_property = ec2.CfnLaunchTemplate.CreditSpecificationProperty(
    cpu_credits="cpuCredits"
)

Attributes

cpu_credits

The credit option for CPU usage of a T instance.

Valid values: standard | unlimited

Link

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

EbsProperty

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

Bases: object

Parameters for a block device for an EBS volume in an Amazon EC2 launch template.

Ebs is a property of AWS::EC2::LaunchTemplate BlockDeviceMapping .

Parameters
  • delete_on_termination (Union[bool, IResolvable, None]) – Indicates whether the EBS volume is deleted on instance termination.

  • encrypted (Union[bool, IResolvable, None]) – Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can’t specify an encryption value.

  • 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 supported for io1 , io2 , and gp3 volumes only. This parameter is not supported for gp2 , st1 , sc1 , or standard volumes.

  • kms_key_id (Optional[str]) – The ARN of the symmetric AWS Key Management Service ( AWS KMS ) CMK used for encryption.

  • snapshot_id (Optional[str]) – The ID of the snapshot.

  • throughput (Union[int, float, None]) – The throughput to provision for a gp3 volume, with a maximum of 1,000 MiB/s. Valid Range: Minimum value of 125. Maximum value of 1000.

  • volume_size (Union[int, float, None]) – The size of the volume, in GiBs. You must specify either a snapshot ID or a volume 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

  • volume_type (Optional[str]) – The volume type. For more information, see Amazon EBS volume types in the Amazon Elastic Compute Cloud User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-blockdevicemapping-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.
import aws_cdk.aws_ec2 as ec2

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

Attributes

delete_on_termination

Indicates whether the EBS volume is deleted on instance termination.

Link

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

encrypted

Indicates whether the EBS volume is encrypted.

Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can’t specify an encryption value.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-blockdevicemapping-ebs.html#cfn-ec2-launchtemplate-blockdevicemapping-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 supported for io1 , io2 , and gp3 volumes only. This parameter is not supported for gp2 , st1 , sc1 , or standard volumes.

Link

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

kms_key_id

The ARN of the symmetric AWS Key Management Service ( AWS KMS ) CMK used for encryption.

Link

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

snapshot_id

The ID of the snapshot.

Link

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

throughput

The throughput to provision for a gp3 volume, with a maximum of 1,000 MiB/s.

Valid Range: Minimum value of 125. Maximum value of 1000.

Link

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

volume_size

The size of the volume, in GiBs.

You must specify either a snapshot ID or a volume 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

Link

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

volume_type

The volume type.

For more information, see Amazon EBS volume types in the Amazon Elastic Compute Cloud User Guide .

Link

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

ElasticGpuSpecificationProperty

class CfnLaunchTemplate.ElasticGpuSpecificationProperty(*, type=None)

Bases: object

Specifies a specification for an Elastic GPU for an Amazon EC2 launch template.

ElasticGpuSpecification is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters

type (Optional[str]) – The type of Elastic Graphics accelerator. For more information about the values to specify for Type , see Elastic Graphics Basics , specifically the Elastic Graphics accelerator column, in the Amazon Elastic Compute Cloud User Guide for Windows Instances .

Link

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

ExampleMetadata

fixture=_generated

Example:

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

elastic_gpu_specification_property = ec2.CfnLaunchTemplate.ElasticGpuSpecificationProperty(
    type="type"
)

Attributes

type

The type of Elastic Graphics accelerator.

For more information about the values to specify for Type , see Elastic Graphics Basics , specifically the Elastic Graphics accelerator column, in the Amazon Elastic Compute Cloud User Guide for Windows Instances .

Link

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

EnclaveOptionsProperty

class CfnLaunchTemplate.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.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-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.
import aws_cdk.aws_ec2 as ec2

enclave_options_property = ec2.CfnLaunchTemplate.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.

Link

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

HibernationOptionsProperty

class CfnLaunchTemplate.HibernationOptionsProperty(*, configured=None)

Bases: object

Specifies whether your instance is configured for hibernation.

This parameter is valid only if the instance meets the hibernation prerequisites . For more information, see Hibernate Your Instance in the Amazon EC2 User Guide .

HibernationOptions is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters

configured (Union[bool, IResolvable, None]) – If you set this parameter to true , the instance is enabled for hibernation. Default: false

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-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.
import aws_cdk.aws_ec2 as ec2

hibernation_options_property = ec2.CfnLaunchTemplate.HibernationOptionsProperty(
    configured=False
)

Attributes

configured

If you set this parameter to true , the instance is enabled for hibernation.

Default: false

Link

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

IamInstanceProfileProperty

class CfnLaunchTemplate.IamInstanceProfileProperty(*, arn=None, name=None)

Bases: object

Specifies an IAM instance profile, which is a container for an IAM role for your instance.

You can use an IAM role to distribute your AWS credentials to your instances.

If you are creating the launch template for use with an Amazon EC2 Auto Scaling group, you can specify either the name or the ARN of the instance profile, but not both.

IamInstanceProfile is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters
  • arn (Optional[str]) – The Amazon Resource Name (ARN) of the instance profile.

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-iaminstanceprofile.html

ExampleMetadata

fixture=_generated

Example:

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

iam_instance_profile_property = ec2.CfnLaunchTemplate.IamInstanceProfileProperty(
    arn="arn",
    name="name"
)

Attributes

arn

The Amazon Resource Name (ARN) of the instance profile.

Link

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

name

The name of the instance profile.

Link

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

InstanceMarketOptionsProperty

class CfnLaunchTemplate.InstanceMarketOptionsProperty(*, market_type=None, spot_options=None)

Bases: object

Specifies the market (purchasing) option for an instance.

InstanceMarketOptions is a property of the AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters
  • market_type (Optional[str]) – The market type.

  • spot_options (Union[IResolvable, SpotOptionsProperty, Dict[str, Any], None]) – The options for Spot Instances.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-instancemarketoptions.html

ExampleMetadata

fixture=_generated

Example:

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

instance_market_options_property = ec2.CfnLaunchTemplate.InstanceMarketOptionsProperty(
    market_type="marketType",
    spot_options=ec2.CfnLaunchTemplate.SpotOptionsProperty(
        block_duration_minutes=123,
        instance_interruption_behavior="instanceInterruptionBehavior",
        max_price="maxPrice",
        spot_instance_type="spotInstanceType",
        valid_until="validUntil"
    )
)

Attributes

market_type

The market type.

Link

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

spot_options

The options for Spot Instances.

Link

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

InstanceRequirementsProperty

class CfnLaunchTemplate.InstanceRequirementsProperty(*, accelerator_count=None, accelerator_manufacturers=None, accelerator_names=None, accelerator_total_memory_mib=None, accelerator_types=None, allowed_instance_types=None, bare_metal=None, baseline_ebs_bandwidth_mbps=None, burstable_performance=None, cpu_manufacturers=None, excluded_instance_types=None, instance_generations=None, local_storage=None, local_storage_types=None, memory_gib_per_v_cpu=None, memory_mib=None, network_bandwidth_gbps=None, network_interface_count=None, on_demand_max_price_percentage_over_lowest_price=None, require_hibernate_support=None, spot_max_price_percentage_over_lowest_price=None, total_local_storage_gb=None, v_cpu_count=None)

Bases: object

The attributes for the instance types.

When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.

When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.

To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request:

  • AllowedInstanceTypes - The instance types to include in the list. All other instance types are ignored, even if they match your specified attributes.

  • ExcludedInstanceTypes - The instance types to exclude from the list, even if they match your specified attributes.

You must specify VCpuCount and MemoryMiB . All other attributes are optional. Any unspecified optional attribute is set to its default.

For more information, see Attribute-based instance type selection for EC2 Fleet , Attribute-based instance type selection for Spot Fleet , and Spot placement score in the Amazon EC2 User Guide .

Parameters
  • accelerator_count (Union[IResolvable, AcceleratorCountProperty, Dict[str, Any], None]) – The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance. To exclude accelerator-enabled instance types, set Max to 0 . Default: No minimum or maximum limits

  • accelerator_manufacturers (Optional[Sequence[str]]) – Indicates whether instance types must have accelerators by specific manufacturers. - For instance types with NVIDIA devices, specify nvidia . - For instance types with AMD devices, specify amd . - For instance types with AWS devices, specify amazon-web-services . - For instance types with Xilinx devices, specify xilinx . Default: Any manufacturer

  • accelerator_names (Optional[Sequence[str]]) – The accelerators that must be on the instance type. - For instance types with NVIDIA A100 GPUs, specify a100 . - For instance types with NVIDIA V100 GPUs, specify v100 . - For instance types with NVIDIA K80 GPUs, specify k80 . - For instance types with NVIDIA T4 GPUs, specify t4 . - For instance types with NVIDIA M60 GPUs, specify m60 . - For instance types with AMD Radeon Pro V520 GPUs, specify radeon-pro-v520 . - For instance types with Xilinx VU9P FPGAs, specify vu9p . - For instance types with AWS Inferentia chips, specify inferentia . - For instance types with NVIDIA GRID K520 GPUs, specify k520 . Default: Any accelerator

  • accelerator_total_memory_mib (Union[IResolvable, AcceleratorTotalMemoryMiBProperty, Dict[str, Any], None]) – The minimum and maximum amount of total accelerator memory, in MiB. Default: No minimum or maximum limits

  • accelerator_types (Optional[Sequence[str]]) – The accelerator types that must be on the instance type. - For instance types with GPU accelerators, specify gpu . - For instance types with FPGA accelerators, specify fpga . - For instance types with inference accelerators, specify inference . Default: Any accelerator type

  • allowed_instance_types (Optional[Sequence[str]]) – The instance types to apply your specified attributes against. All other instance types are ignored, even if they match your specified attributes. You can use strings with one or more wild cards, represented by an asterisk ( * ), to allow an instance type, size, or generation. The following are examples: m5.8xlarge , c5*.* , m5a.* , r* , *3* . For example, if you specify c5* ,Amazon EC2 will allow the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.* , Amazon EC2 will allow all the M5a instance types, but not the M5n instance types. .. epigraph:: If you specify AllowedInstanceTypes , you can’t specify ExcludedInstanceTypes . Default: All instance types

  • bare_metal (Optional[str]) – Indicates whether bare metal instance types must be included, excluded, or required. - To include bare metal instance types, specify included . - To require only bare metal instance types, specify required . - To exclude bare metal instance types, specify excluded . Default: excluded

  • baseline_ebs_bandwidth_mbps (Union[IResolvable, BaselineEbsBandwidthMbpsProperty, Dict[str, Any], None]) –

    The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide . Default: No minimum or maximum limits

  • burstable_performance (Optional[str]) – Indicates whether burstable performance T instance types are included, excluded, or required. For more information, see Burstable performance instances . - To include burstable performance instance types, specify included . - To require only burstable performance instance types, specify required . - To exclude burstable performance instance types, specify excluded . Default: excluded

  • cpu_manufacturers (Optional[Sequence[str]]) – The CPU manufacturers to include. - For instance types with Intel CPUs, specify intel . - For instance types with AMD CPUs, specify amd . - For instance types with AWS CPUs, specify amazon-web-services . .. epigraph:: Don’t confuse the CPU manufacturer with the CPU architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you specify in your launch template. Default: Any manufacturer

  • excluded_instance_types (Optional[Sequence[str]]) – The instance types to exclude. You can use strings with one or more wild cards, represented by an asterisk ( * ), to exclude an instance type, size, or generation. The following are examples: m5.8xlarge , c5*.* , m5a.* , r* , *3* . For example, if you specify c5* ,Amazon EC2 will exclude the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.* , Amazon EC2 will exclude all the M5a instance types, but not the M5n instance types. .. epigraph:: If you specify ExcludedInstanceTypes , you can’t specify AllowedInstanceTypes . Default: No excluded instance types

  • instance_generations (Optional[Sequence[str]]) – Indicates whether current or previous generation instance types are included. The current generation instance types are recommended for use. Current generation instance types are typically the latest two to three generations in each instance family. For more information, see Instance types in the Amazon EC2 User Guide . For current generation instance types, specify current . For previous generation instance types, specify previous . Default: Current and previous generation instance types

  • local_storage (Optional[str]) – Indicates whether instance types with instance store volumes are included, excluded, or required. For more information, Amazon EC2 instance store in the Amazon EC2 User Guide . - To include instance types with instance store volumes, specify included . - To require only instance types with instance store volumes, specify required . - To exclude instance types with instance store volumes, specify excluded . Default: included

  • local_storage_types (Optional[Sequence[str]]) – The type of local storage that is required. - For instance types with hard disk drive (HDD) storage, specify hdd . - For instance types with solid state drive (SSD) storage, specify ssd . Default: hdd and ssd

  • memory_gib_per_v_cpu (Union[IResolvable, MemoryGiBPerVCpuProperty, Dict[str, Any], None]) – The minimum and maximum amount of memory per vCPU, in GiB. Default: No minimum or maximum limits

  • memory_mib (Union[IResolvable, MemoryMiBProperty, Dict[str, Any], None]) – The minimum and maximum amount of memory, in MiB.

  • network_bandwidth_gbps (Union[IResolvable, NetworkBandwidthGbpsProperty, Dict[str, Any], None]) – The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps). Default: No minimum or maximum limits

  • network_interface_count (Union[IResolvable, NetworkInterfaceCountProperty, Dict[str, Any], None]) – The minimum and maximum number of network interfaces. Default: No minimum or maximum limits

  • on_demand_max_price_percentage_over_lowest_price (Union[int, float, None]) – The price protection threshold for On-Demand Instances. This is the maximum you’ll pay for an On-Demand Instance, expressed as a percentage above the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it excludes instance types priced above your threshold. The parameter accepts an integer, which Amazon EC2 interprets as a percentage. To turn off price protection, specify a high value, such as 999999 . This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements . .. epigraph:: If you set TargetCapacityUnitType to vcpu or memory-mib , the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price. Default: 20

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

    Indicates whether instance types must support hibernation for On-Demand Instances. This parameter is not supported for GetSpotPlacementScores . Default: false

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

    The price protection threshold for Spot Instances. This is the maximum you’ll pay for a Spot Instance, expressed as a percentage above the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it excludes instance types priced above your threshold. The parameter accepts an integer, which Amazon EC2 interprets as a percentage. To turn off price protection, specify a high value, such as 999999 . This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements . .. epigraph:: If you set TargetCapacityUnitType to vcpu or memory-mib , the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price. Default: 100

  • total_local_storage_gb (Union[IResolvable, TotalLocalStorageGBProperty, Dict[str, Any], None]) – The minimum and maximum amount of total local storage, in GB. Default: No minimum or maximum limits

  • v_cpu_count (Union[IResolvable, VCpuCountProperty, Dict[str, Any], None]) – The minimum and maximum number of vCPUs.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-instancerequirements.html

ExampleMetadata

fixture=_generated

Example:

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

instance_requirements_property = ec2.CfnLaunchTemplate.InstanceRequirementsProperty(
    accelerator_count=ec2.CfnLaunchTemplate.AcceleratorCountProperty(
        max=123,
        min=123
    ),
    accelerator_manufacturers=["acceleratorManufacturers"],
    accelerator_names=["acceleratorNames"],
    accelerator_total_memory_mi_b=ec2.CfnLaunchTemplate.AcceleratorTotalMemoryMiBProperty(
        max=123,
        min=123
    ),
    accelerator_types=["acceleratorTypes"],
    allowed_instance_types=["allowedInstanceTypes"],
    bare_metal="bareMetal",
    baseline_ebs_bandwidth_mbps=ec2.CfnLaunchTemplate.BaselineEbsBandwidthMbpsProperty(
        max=123,
        min=123
    ),
    burstable_performance="burstablePerformance",
    cpu_manufacturers=["cpuManufacturers"],
    excluded_instance_types=["excludedInstanceTypes"],
    instance_generations=["instanceGenerations"],
    local_storage="localStorage",
    local_storage_types=["localStorageTypes"],
    memory_gi_bPer_vCpu=ec2.CfnLaunchTemplate.MemoryGiBPerVCpuProperty(
        max=123,
        min=123
    ),
    memory_mi_b=ec2.CfnLaunchTemplate.MemoryMiBProperty(
        max=123,
        min=123
    ),
    network_bandwidth_gbps=ec2.CfnLaunchTemplate.NetworkBandwidthGbpsProperty(
        max=123,
        min=123
    ),
    network_interface_count=ec2.CfnLaunchTemplate.NetworkInterfaceCountProperty(
        max=123,
        min=123
    ),
    on_demand_max_price_percentage_over_lowest_price=123,
    require_hibernate_support=False,
    spot_max_price_percentage_over_lowest_price=123,
    total_local_storage_gb=ec2.CfnLaunchTemplate.TotalLocalStorageGBProperty(
        max=123,
        min=123
    ),
    v_cpu_count=ec2.CfnLaunchTemplate.VCpuCountProperty(
        max=123,
        min=123
    )
)

Attributes

accelerator_count

The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance.

To exclude accelerator-enabled instance types, set Max to 0 .

Default: No minimum or maximum limits

Link

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

accelerator_manufacturers

Indicates whether instance types must have accelerators by specific manufacturers.

  • For instance types with NVIDIA devices, specify nvidia .

  • For instance types with AMD devices, specify amd .

  • For instance types with AWS devices, specify amazon-web-services .

  • For instance types with Xilinx devices, specify xilinx .

Default: Any manufacturer

Link

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

accelerator_names

The accelerators that must be on the instance type.

  • For instance types with NVIDIA A100 GPUs, specify a100 .

  • For instance types with NVIDIA V100 GPUs, specify v100 .

  • For instance types with NVIDIA K80 GPUs, specify k80 .

  • For instance types with NVIDIA T4 GPUs, specify t4 .

  • For instance types with NVIDIA M60 GPUs, specify m60 .

  • For instance types with AMD Radeon Pro V520 GPUs, specify radeon-pro-v520 .

  • For instance types with Xilinx VU9P FPGAs, specify vu9p .

  • For instance types with AWS Inferentia chips, specify inferentia .

  • For instance types with NVIDIA GRID K520 GPUs, specify k520 .

Default: Any accelerator

Link

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

accelerator_total_memory_mib

The minimum and maximum amount of total accelerator memory, in MiB.

Default: No minimum or maximum limits

Link

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

accelerator_types

The accelerator types that must be on the instance type.

  • For instance types with GPU accelerators, specify gpu .

  • For instance types with FPGA accelerators, specify fpga .

  • For instance types with inference accelerators, specify inference .

Default: Any accelerator type

Link

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

allowed_instance_types

The instance types to apply your specified attributes against.

All other instance types are ignored, even if they match your specified attributes.

You can use strings with one or more wild cards, represented by an asterisk ( * ), to allow an instance type, size, or generation. The following are examples: m5.8xlarge , c5*.* , m5a.* , r* , *3* .

For example, if you specify c5* ,Amazon EC2 will allow the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.* , Amazon EC2 will allow all the M5a instance types, but not the M5n instance types. .. epigraph:

If you specify ``AllowedInstanceTypes`` , you can't specify ``ExcludedInstanceTypes`` .

Default: All instance types

Link

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

bare_metal

Indicates whether bare metal instance types must be included, excluded, or required.

  • To include bare metal instance types, specify included .

  • To require only bare metal instance types, specify required .

  • To exclude bare metal instance types, specify excluded .

Default: excluded

Link

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

baseline_ebs_bandwidth_mbps

The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps.

For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide .

Default: No minimum or maximum limits

Link

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

burstable_performance

Indicates whether burstable performance T instance types are included, excluded, or required.

For more information, see Burstable performance instances .

  • To include burstable performance instance types, specify included .

  • To require only burstable performance instance types, specify required .

  • To exclude burstable performance instance types, specify excluded .

Default: excluded

Link

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

cpu_manufacturers

The CPU manufacturers to include.

  • For instance types with Intel CPUs, specify intel .

  • For instance types with AMD CPUs, specify amd .

  • For instance types with AWS CPUs, specify amazon-web-services .

Don’t confuse the CPU manufacturer with the CPU architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you specify in your launch template.

Default: Any manufacturer

Link

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

excluded_instance_types

The instance types to exclude.

You can use strings with one or more wild cards, represented by an asterisk ( * ), to exclude an instance type, size, or generation. The following are examples: m5.8xlarge , c5*.* , m5a.* , r* , *3* .

For example, if you specify c5* ,Amazon EC2 will exclude the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.* , Amazon EC2 will exclude all the M5a instance types, but not the M5n instance types. .. epigraph:

If you specify ``ExcludedInstanceTypes`` , you can't specify ``AllowedInstanceTypes`` .

Default: No excluded instance types

Link

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

instance_generations

Indicates whether current or previous generation instance types are included.

The current generation instance types are recommended for use. Current generation instance types are typically the latest two to three generations in each instance family. For more information, see Instance types in the Amazon EC2 User Guide .

For current generation instance types, specify current .

For previous generation instance types, specify previous .

Default: Current and previous generation instance types

Link

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

local_storage

Indicates whether instance types with instance store volumes are included, excluded, or required.

For more information, Amazon EC2 instance store in the Amazon EC2 User Guide .

  • To include instance types with instance store volumes, specify included .

  • To require only instance types with instance store volumes, specify required .

  • To exclude instance types with instance store volumes, specify excluded .

Default: included

Link

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

local_storage_types

The type of local storage that is required.

  • For instance types with hard disk drive (HDD) storage, specify hdd .

  • For instance types with solid state drive (SSD) storage, specify ssd .

Default: hdd and ssd

Link

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

memory_gib_per_v_cpu

The minimum and maximum amount of memory per vCPU, in GiB.

Default: No minimum or maximum limits

Link

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

memory_mib

The minimum and maximum amount of memory, in MiB.

Link

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

network_bandwidth_gbps

The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps).

Default: No minimum or maximum limits

Link

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

network_interface_count

The minimum and maximum number of network interfaces.

Default: No minimum or maximum limits

Link

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

on_demand_max_price_percentage_over_lowest_price

The price protection threshold for On-Demand Instances.

This is the maximum you’ll pay for an On-Demand Instance, expressed as a percentage above the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it excludes instance types priced above your threshold.

The parameter accepts an integer, which Amazon EC2 interprets as a percentage.

To turn off price protection, specify a high value, such as 999999 .

This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements . .. epigraph:

If you set ``TargetCapacityUnitType`` to ``vcpu`` or ``memory-mib`` , the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price.

Default: 20

Link

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

require_hibernate_support

Indicates whether instance types must support hibernation for On-Demand Instances.

This parameter is not supported for GetSpotPlacementScores .

Default: false

Link

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

spot_max_price_percentage_over_lowest_price

The price protection threshold for Spot Instances.

This is the maximum you’ll pay for a Spot Instance, expressed as a percentage above the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it excludes instance types priced above your threshold.

The parameter accepts an integer, which Amazon EC2 interprets as a percentage.

To turn off price protection, specify a high value, such as 999999 .

This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements . .. epigraph:

If you set ``TargetCapacityUnitType`` to ``vcpu`` or ``memory-mib`` , the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price.

Default: 100

Link

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

total_local_storage_gb

The minimum and maximum amount of total local storage, in GB.

Default: No minimum or maximum limits

Link

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

v_cpu_count

The minimum and maximum number of vCPUs.

Link

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

Ipv4PrefixSpecificationProperty

class CfnLaunchTemplate.Ipv4PrefixSpecificationProperty(*, ipv4_prefix=None)

Bases: object

Specifies an IPv4 prefix for a network interface.

Ipv4PrefixSpecification is a property of AWS::EC2::LaunchTemplate NetworkInterface .

Parameters

ipv4_prefix (Optional[str]) – The IPv4 prefix. For information, see Assigning prefixes to Amazon EC2 network interfaces in the Amazon Elastic Compute Cloud User Guide .

Link

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

ExampleMetadata

fixture=_generated

Example:

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

ipv4_prefix_specification_property = ec2.CfnLaunchTemplate.Ipv4PrefixSpecificationProperty(
    ipv4_prefix="ipv4Prefix"
)

Attributes

ipv4_prefix

The IPv4 prefix.

For information, see Assigning prefixes to Amazon EC2 network interfaces in the Amazon Elastic Compute Cloud User Guide .

Link

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

Ipv6AddProperty

class CfnLaunchTemplate.Ipv6AddProperty(*, ipv6_address=None)

Bases: object

Specifies an IPv6 address in an Amazon EC2 launch template.

Ipv6Add is a property of AWS::EC2::LaunchTemplate NetworkInterface .

Parameters

ipv6_address (Optional[str]) – One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can’t use this option if you’re specifying a number of IPv6 addresses.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

ipv6_add_property = ec2.CfnLaunchTemplate.Ipv6AddProperty(
    ipv6_address="ipv6Address"
)

Attributes

ipv6_address

One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet.

You can’t use this option if you’re specifying a number of IPv6 addresses.

Link

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

Ipv6PrefixSpecificationProperty

class CfnLaunchTemplate.Ipv6PrefixSpecificationProperty(*, ipv6_prefix=None)

Bases: object

Specifies an IPv6 prefix for a network interface.

Ipv6PrefixSpecification is a property of AWS::EC2::LaunchTemplate NetworkInterface .

Parameters

ipv6_prefix (Optional[str]) – The IPv6 prefix.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

ipv6_prefix_specification_property = ec2.CfnLaunchTemplate.Ipv6PrefixSpecificationProperty(
    ipv6_prefix="ipv6Prefix"
)

Attributes

ipv6_prefix

The IPv6 prefix.

Link

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

LaunchTemplateDataProperty

class CfnLaunchTemplate.LaunchTemplateDataProperty(*, block_device_mappings=None, capacity_reservation_specification=None, cpu_options=None, credit_specification=None, disable_api_stop=None, disable_api_termination=None, ebs_optimized=None, elastic_gpu_specifications=None, elastic_inference_accelerators=None, enclave_options=None, hibernation_options=None, iam_instance_profile=None, image_id=None, instance_initiated_shutdown_behavior=None, instance_market_options=None, instance_requirements=None, instance_type=None, kernel_id=None, key_name=None, license_specifications=None, maintenance_options=None, metadata_options=None, monitoring=None, network_interfaces=None, placement=None, private_dns_name_options=None, ram_disk_id=None, security_group_ids=None, security_groups=None, tag_specifications=None, user_data=None)

Bases: object

The information to include in the launch template.

You must specify at least one parameter for the launch template data.

Parameters
  • block_device_mappings (Union[IResolvable, Sequence[Union[IResolvable, BlockDeviceMappingProperty, Dict[str, Any]]], None]) – The block device mapping.

  • capacity_reservation_specification (Union[IResolvable, CapacityReservationSpecificationProperty, Dict[str, Any], None]) – The Capacity Reservation targeting option. If you do not specify this parameter, the instance’s Capacity Reservation preference defaults to open , which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).

  • cpu_options (Union[IResolvable, CpuOptionsProperty, Dict[str, Any], None]) – The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .

  • credit_specification (Union[IResolvable, CreditSpecificationProperty, Dict[str, Any], None]) – The credit option for CPU usage of the instance. Valid only for T instances.

  • disable_api_stop (Union[bool, IResolvable, None]) – Indicates whether to enable the instance for stop protection. For more information, see Stop protection in the Amazon Elastic Compute Cloud User Guide .

  • disable_api_termination (Union[bool, IResolvable, None]) – If you set this parameter to true , you can’t terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.

  • ebs_optimized (Union[bool, IResolvable, None]) – Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn’t available with all instance types. Additional usage charges apply when using an EBS-optimized instance.

  • elastic_gpu_specifications (Union[IResolvable, Sequence[Union[IResolvable, ElasticGpuSpecificationProperty, Dict[str, Any]]], None]) – An elastic GPU to associate with the instance.

  • elastic_inference_accelerators (Union[IResolvable, Sequence[Union[IResolvable, LaunchTemplateElasticInferenceAcceleratorProperty, Dict[str, Any]]], None]) – The elastic inference accelerator for the instance.

  • enclave_options (Union[IResolvable, EnclaveOptionsProperty, Dict[str, Any], None]) – Indicates whether the instance is enabled for AWS Nitro Enclaves. For more information, see What is AWS Nitro Enclaves? in the AWS Nitro Enclaves User Guide . You can’t enable AWS Nitro Enclaves and hibernation on the same instance.

  • hibernation_options (Union[IResolvable, HibernationOptionsProperty, Dict[str, Any], None]) –

    Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the hibernation prerequisites . For more information, see Hibernate your instance in the Amazon Elastic Compute Cloud User Guide .

  • iam_instance_profile (Union[IResolvable, IamInstanceProfileProperty, Dict[str, Any], None]) – The name or Amazon Resource Name (ARN) of an IAM instance profile.

  • image_id (Optional[str]) – The ID of the AMI. Alternatively, you can specify a Systems Manager parameter, which will resolve to an AMI ID on launch. Valid formats: - ami-17characters00000 - resolve:ssm:parameter-name - resolve:ssm:parameter-name:version-number - resolve:ssm:parameter-name:label For more information, see Use a Systems Manager parameter to find an AMI in the Amazon Elastic Compute Cloud User Guide .

  • instance_initiated_shutdown_behavior (Optional[str]) – Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown). Default: stop

  • instance_market_options (Union[IResolvable, InstanceMarketOptionsProperty, Dict[str, Any], None]) – The market (purchasing) option for the instances.

  • instance_requirements (Union[IResolvable, InstanceRequirementsProperty, Dict[str, Any], None]) – The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with these attributes. If you specify InstanceRequirements , you can’t specify InstanceType .

  • instance_type (Optional[str]) –

    The instance type. For more information, see Instance types in the Amazon Elastic Compute Cloud User Guide . If you specify InstanceType , you can’t specify InstanceRequirements .

  • kernel_id (Optional[str]) – The ID of the kernel. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon EC2 User Guide .

  • key_name (Optional[str]) – The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair . .. epigraph:: If you do not specify a key pair, you can’t connect to the instance unless you choose an AMI that is configured to allow users another way to log in.

  • license_specifications (Union[IResolvable, Sequence[Union[IResolvable, LicenseSpecificationProperty, Dict[str, Any]]], None]) – The license configurations.

  • maintenance_options (Union[IResolvable, MaintenanceOptionsProperty, Dict[str, Any], None]) – The maintenance options of your instance.

  • metadata_options (Union[IResolvable, MetadataOptionsProperty, Dict[str, Any], None]) – The metadata options for the instance. For more information, see Instance metadata and user data in the Amazon Elastic Compute Cloud User Guide .

  • monitoring (Union[IResolvable, MonitoringProperty, Dict[str, Any], None]) – The monitoring for the instance.

  • network_interfaces (Union[IResolvable, Sequence[Union[IResolvable, NetworkInterfaceProperty, Dict[str, Any]]], None]) – One or more network interfaces. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.

  • placement (Union[IResolvable, PlacementProperty, Dict[str, Any], None]) – The placement for the instance.

  • private_dns_name_options (Union[IResolvable, PrivateDnsNameOptionsProperty, Dict[str, Any], None]) – The options for the instance hostname. The default values are inherited from the subnet.

  • ram_disk_id (Optional[str]) –

    The ID of the RAM disk. .. epigraph:: We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon Elastic Compute Cloud User Guide .

  • security_group_ids (Optional[Sequence[str]]) – One or more security group IDs. You can create a security group using CreateSecurityGroup . You cannot specify both a security group ID and security name in the same request.

  • security_groups (Optional[Sequence[str]]) – One or more security group names. For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.

  • tag_specifications (Union[IResolvable, Sequence[Union[IResolvable, TagSpecificationProperty, Dict[str, Any]]], None]) – The tags to apply to the resources that are created during instance launch. You can specify tags for the following resources only: - Instances - Volumes - Elastic graphics - Spot Instance requests - Network interfaces To tag a resource after it has been created, see CreateTags . .. epigraph:: To tag the launch template itself, you must use the TagSpecification parameter.

  • user_data (Optional[str]) – The user data to make available to the instance. You must provide base64-encoded text. User data is limited to 16 KB. For more information, see Run commands on your Linux instance at launch (Linux) or Work with instance user data (Windows) in the Amazon Elastic Compute Cloud User Guide . If you are creating the launch template for use with AWS Batch , the user data must be provided in the MIME multi-part archive format . For more information, see Amazon EC2 user data in launch templates in the AWS Batch User Guide .

Link

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

ExampleMetadata

fixture=_generated

Example:

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

launch_template_data_property = ec2.CfnLaunchTemplate.LaunchTemplateDataProperty(
    block_device_mappings=[ec2.CfnLaunchTemplate.BlockDeviceMappingProperty(
        device_name="deviceName",
        ebs=ec2.CfnLaunchTemplate.EbsProperty(
            delete_on_termination=False,
            encrypted=False,
            iops=123,
            kms_key_id="kmsKeyId",
            snapshot_id="snapshotId",
            throughput=123,
            volume_size=123,
            volume_type="volumeType"
        ),
        no_device="noDevice",
        virtual_name="virtualName"
    )],
    capacity_reservation_specification=ec2.CfnLaunchTemplate.CapacityReservationSpecificationProperty(
        capacity_reservation_preference="capacityReservationPreference",
        capacity_reservation_target=ec2.CfnLaunchTemplate.CapacityReservationTargetProperty(
            capacity_reservation_id="capacityReservationId",
            capacity_reservation_resource_group_arn="capacityReservationResourceGroupArn"
        )
    ),
    cpu_options=ec2.CfnLaunchTemplate.CpuOptionsProperty(
        core_count=123,
        threads_per_core=123
    ),
    credit_specification=ec2.CfnLaunchTemplate.CreditSpecificationProperty(
        cpu_credits="cpuCredits"
    ),
    disable_api_stop=False,
    disable_api_termination=False,
    ebs_optimized=False,
    elastic_gpu_specifications=[ec2.CfnLaunchTemplate.ElasticGpuSpecificationProperty(
        type="type"
    )],
    elastic_inference_accelerators=[ec2.CfnLaunchTemplate.LaunchTemplateElasticInferenceAcceleratorProperty(
        count=123,
        type="type"
    )],
    enclave_options=ec2.CfnLaunchTemplate.EnclaveOptionsProperty(
        enabled=False
    ),
    hibernation_options=ec2.CfnLaunchTemplate.HibernationOptionsProperty(
        configured=False
    ),
    iam_instance_profile=ec2.CfnLaunchTemplate.IamInstanceProfileProperty(
        arn="arn",
        name="name"
    ),
    image_id="imageId",
    instance_initiated_shutdown_behavior="instanceInitiatedShutdownBehavior",
    instance_market_options=ec2.CfnLaunchTemplate.InstanceMarketOptionsProperty(
        market_type="marketType",
        spot_options=ec2.CfnLaunchTemplate.SpotOptionsProperty(
            block_duration_minutes=123,
            instance_interruption_behavior="instanceInterruptionBehavior",
            max_price="maxPrice",
            spot_instance_type="spotInstanceType",
            valid_until="validUntil"
        )
    ),
    instance_requirements=ec2.CfnLaunchTemplate.InstanceRequirementsProperty(
        accelerator_count=ec2.CfnLaunchTemplate.AcceleratorCountProperty(
            max=123,
            min=123
        ),
        accelerator_manufacturers=["acceleratorManufacturers"],
        accelerator_names=["acceleratorNames"],
        accelerator_total_memory_mi_b=ec2.CfnLaunchTemplate.AcceleratorTotalMemoryMiBProperty(
            max=123,
            min=123
        ),
        accelerator_types=["acceleratorTypes"],
        allowed_instance_types=["allowedInstanceTypes"],
        bare_metal="bareMetal",
        baseline_ebs_bandwidth_mbps=ec2.CfnLaunchTemplate.BaselineEbsBandwidthMbpsProperty(
            max=123,
            min=123
        ),
        burstable_performance="burstablePerformance",
        cpu_manufacturers=["cpuManufacturers"],
        excluded_instance_types=["excludedInstanceTypes"],
        instance_generations=["instanceGenerations"],
        local_storage="localStorage",
        local_storage_types=["localStorageTypes"],
        memory_gi_bPer_vCpu=ec2.CfnLaunchTemplate.MemoryGiBPerVCpuProperty(
            max=123,
            min=123
        ),
        memory_mi_b=ec2.CfnLaunchTemplate.MemoryMiBProperty(
            max=123,
            min=123
        ),
        network_bandwidth_gbps=ec2.CfnLaunchTemplate.NetworkBandwidthGbpsProperty(
            max=123,
            min=123
        ),
        network_interface_count=ec2.CfnLaunchTemplate.NetworkInterfaceCountProperty(
            max=123,
            min=123
        ),
        on_demand_max_price_percentage_over_lowest_price=123,
        require_hibernate_support=False,
        spot_max_price_percentage_over_lowest_price=123,
        total_local_storage_gb=ec2.CfnLaunchTemplate.TotalLocalStorageGBProperty(
            max=123,
            min=123
        ),
        v_cpu_count=ec2.CfnLaunchTemplate.VCpuCountProperty(
            max=123,
            min=123
        )
    ),
    instance_type="instanceType",
    kernel_id="kernelId",
    key_name="keyName",
    license_specifications=[ec2.CfnLaunchTemplate.LicenseSpecificationProperty(
        license_configuration_arn="licenseConfigurationArn"
    )],
    maintenance_options=ec2.CfnLaunchTemplate.MaintenanceOptionsProperty(
        auto_recovery="autoRecovery"
    ),
    metadata_options=ec2.CfnLaunchTemplate.MetadataOptionsProperty(
        http_endpoint="httpEndpoint",
        http_protocol_ipv6="httpProtocolIpv6",
        http_put_response_hop_limit=123,
        http_tokens="httpTokens",
        instance_metadata_tags="instanceMetadataTags"
    ),
    monitoring=ec2.CfnLaunchTemplate.MonitoringProperty(
        enabled=False
    ),
    network_interfaces=[ec2.CfnLaunchTemplate.NetworkInterfaceProperty(
        associate_carrier_ip_address=False,
        associate_public_ip_address=False,
        delete_on_termination=False,
        description="description",
        device_index=123,
        groups=["groups"],
        interface_type="interfaceType",
        ipv4_prefix_count=123,
        ipv4_prefixes=[ec2.CfnLaunchTemplate.Ipv4PrefixSpecificationProperty(
            ipv4_prefix="ipv4Prefix"
        )],
        ipv6_address_count=123,
        ipv6_addresses=[ec2.CfnLaunchTemplate.Ipv6AddProperty(
            ipv6_address="ipv6Address"
        )],
        ipv6_prefix_count=123,
        ipv6_prefixes=[ec2.CfnLaunchTemplate.Ipv6PrefixSpecificationProperty(
            ipv6_prefix="ipv6Prefix"
        )],
        network_card_index=123,
        network_interface_id="networkInterfaceId",
        private_ip_address="privateIpAddress",
        private_ip_addresses=[ec2.CfnLaunchTemplate.PrivateIpAddProperty(
            primary=False,
            private_ip_address="privateIpAddress"
        )],
        secondary_private_ip_address_count=123,
        subnet_id="subnetId"
    )],
    placement=ec2.CfnLaunchTemplate.PlacementProperty(
        affinity="affinity",
        availability_zone="availabilityZone",
        group_id="groupId",
        group_name="groupName",
        host_id="hostId",
        host_resource_group_arn="hostResourceGroupArn",
        partition_number=123,
        spread_domain="spreadDomain",
        tenancy="tenancy"
    ),
    private_dns_name_options=ec2.CfnLaunchTemplate.PrivateDnsNameOptionsProperty(
        enable_resource_name_dns_aaaa_record=False,
        enable_resource_name_dns_aRecord=False,
        hostname_type="hostnameType"
    ),
    ram_disk_id="ramDiskId",
    security_group_ids=["securityGroupIds"],
    security_groups=["securityGroups"],
    tag_specifications=[ec2.CfnLaunchTemplate.TagSpecificationProperty(
        resource_type="resourceType",
        tags=[CfnTag(
            key="key",
            value="value"
        )]
    )],
    user_data="userData"
)

Attributes

block_device_mappings

The block device mapping.

Link

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

capacity_reservation_specification

The Capacity Reservation targeting option.

If you do not specify this parameter, the instance’s Capacity Reservation preference defaults to open , which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).

Link

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

cpu_options

The CPU options for the instance.

For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .

Link

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

credit_specification

The credit option for CPU usage of the instance.

Valid only for T instances.

Link

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

disable_api_stop

Indicates whether to enable the instance for stop protection.

For more information, see Stop protection in the Amazon Elastic Compute Cloud User Guide .

Link

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

disable_api_termination

If you set this parameter to true , you can’t terminate the instance using the Amazon EC2 console, CLI, or API;

otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.

Link

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

ebs_optimized

Indicates whether the instance is optimized for Amazon EBS I/O.

This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn’t available with all instance types. Additional usage charges apply when using an EBS-optimized instance.

Link

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

elastic_gpu_specifications

An elastic GPU to associate with the instance.

Link

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

elastic_inference_accelerators

The elastic inference accelerator for the instance.

Link

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

enclave_options

Indicates whether the instance is enabled for AWS Nitro Enclaves.

For more information, see What is AWS Nitro Enclaves? in the AWS Nitro Enclaves User Guide .

You can’t enable AWS Nitro Enclaves and hibernation on the same instance.

Link

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

hibernation_options

Indicates whether an instance is enabled for hibernation.

This parameter is valid only if the instance meets the hibernation prerequisites . For more information, see Hibernate your instance in the Amazon Elastic Compute Cloud User Guide .

Link

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

iam_instance_profile

The name or Amazon Resource Name (ARN) of an IAM instance profile.

Link

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

image_id

The ID of the AMI.

Alternatively, you can specify a Systems Manager parameter, which will resolve to an AMI ID on launch.

Valid formats:

  • ami-17characters00000

  • resolve:ssm:parameter-name

  • resolve:ssm:parameter-name:version-number

  • resolve:ssm:parameter-name:label

For more information, see Use a Systems Manager parameter to find an AMI in the Amazon Elastic Compute Cloud User Guide .

Link

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

instance_initiated_shutdown_behavior

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Default: stop

Link

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

instance_market_options

The market (purchasing) option for the instances.

Link

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

instance_requirements

The attributes for the instance types.

When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.

If you specify InstanceRequirements , you can’t specify InstanceType .

Link

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

instance_type

//docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html>`_ in the Amazon Elastic Compute Cloud User Guide .

If you specify InstanceType , you can’t specify InstanceRequirements .

Link

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

Type

The instance type. For more information, see `Instance types <https

kernel_id

The ID of the kernel.

We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon EC2 User Guide .

Link

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

key_name

//docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html>`_ .

If you do not specify a key pair, you can’t connect to the instance unless you choose an AMI that is configured to allow users another way to log in.

Link

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

Type

The name of the key pair. You can create a key pair using `CreateKeyPair <https

Type

//docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html>`_ or `ImportKeyPair <https

license_specifications

The license configurations.

Link

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

maintenance_options

The maintenance options of your instance.

Link

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

metadata_options

The metadata options for the instance.

For more information, see Instance metadata and user data in the Amazon Elastic Compute Cloud User Guide .

Link

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

monitoring

The monitoring for the instance.

Link

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

network_interfaces

One or more network interfaces.

If you specify a network interface, you must specify any security groups and subnets as part of the network interface.

Link

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

placement

The placement for the instance.

Link

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

private_dns_name_options

The options for the instance hostname.

The default values are inherited from the subnet.

Link

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

ram_disk_id

The ID of the RAM disk.

We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon Elastic Compute Cloud User Guide .

Link

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

security_group_ids

One or more security group IDs.

You can create a security group using CreateSecurityGroup . You cannot specify both a security group ID and security name in the same request.

Link

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

security_groups

One or more security group names.

For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.

Link

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

tag_specifications

The tags to apply to the resources that are created during instance launch.

You can specify tags for the following resources only:

  • Instances

  • Volumes

  • Elastic graphics

  • Spot Instance requests

  • Network interfaces

To tag a resource after it has been created, see CreateTags . .. epigraph:

To tag the launch template itself, you must use the `TagSpecification <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html>`_ parameter.
Link

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

user_data

The user data to make available to the instance.

You must provide base64-encoded text. User data is limited to 16 KB. For more information, see Run commands on your Linux instance at launch (Linux) or Work with instance user data (Windows) in the Amazon Elastic Compute Cloud User Guide .

If you are creating the launch template for use with AWS Batch , the user data must be provided in the MIME multi-part archive format . For more information, see Amazon EC2 user data in launch templates in the AWS Batch User Guide .

Link

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

LaunchTemplateElasticInferenceAcceleratorProperty

class CfnLaunchTemplate.LaunchTemplateElasticInferenceAcceleratorProperty(*, count=None, type=None)

Bases: object

Specifies an elastic inference accelerator.

LaunchTemplateElasticInferenceAccelerator is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters
  • count (Union[int, float, None]) – The number of elastic inference accelerators to attach to the instance. Default: 1

  • type (Optional[str]) – The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

launch_template_elastic_inference_accelerator_property = ec2.CfnLaunchTemplate.LaunchTemplateElasticInferenceAcceleratorProperty(
    count=123,
    type="type"
)

Attributes

count

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

Default: 1

Link

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

type

The type of elastic inference accelerator.

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

Link

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

LaunchTemplateTagSpecificationProperty

class CfnLaunchTemplate.LaunchTemplateTagSpecificationProperty(*, resource_type=None, tags=None)

Bases: object

Specifies the tags to apply to the launch template during creation.

LaunchTemplateTagSpecification is a property of AWS::EC2::LaunchTemplate .

Parameters
  • resource_type (Optional[str]) – The type of resource. To tag the launch template, ResourceType must be launch-template .

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – The tags for the resource.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

launch_template_tag_specification_property = ec2.CfnLaunchTemplate.LaunchTemplateTagSpecificationProperty(
    resource_type="resourceType",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

resource_type

The type of resource.

To tag the launch template, ResourceType must be launch-template .

Link

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

tags

The tags for the resource.

Link

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

LicenseSpecificationProperty

class CfnLaunchTemplate.LicenseSpecificationProperty(*, license_configuration_arn=None)

Bases: object

Specifies a license configuration for an instance.

LicenseSpecification is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-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.
import aws_cdk.aws_ec2 as ec2

license_specification_property = ec2.CfnLaunchTemplate.LicenseSpecificationProperty(
    license_configuration_arn="licenseConfigurationArn"
)

Attributes

license_configuration_arn

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

Link

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

MaintenanceOptionsProperty

class CfnLaunchTemplate.MaintenanceOptionsProperty(*, auto_recovery=None)

Bases: object

The maintenance options of your instance.

Parameters

auto_recovery (Optional[str]) – Disables the automatic recovery behavior of your instance or sets it to default.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-maintenanceoptions.html

ExampleMetadata

fixture=_generated

Example:

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

maintenance_options_property = ec2.CfnLaunchTemplate.MaintenanceOptionsProperty(
    auto_recovery="autoRecovery"
)

Attributes

auto_recovery

Disables the automatic recovery behavior of your instance or sets it to default.

Link

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

MemoryGiBPerVCpuProperty

class CfnLaunchTemplate.MemoryGiBPerVCpuProperty(*, max=None, min=None)

Bases: object

The minimum and maximum amount of memory per vCPU, in GiB.

Parameters
  • max (Union[int, float, None]) – The maximum amount of memory per vCPU, in GiB. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum amount of memory per vCPU, in GiB. To specify no minimum limit, omit this parameter.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

memory_gi_bPer_vCpu_property = ec2.CfnLaunchTemplate.MemoryGiBPerVCpuProperty(
    max=123,
    min=123
)

Attributes

max

The maximum amount of memory per vCPU, in GiB.

To specify no maximum limit, omit this parameter.

Link

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

min

The minimum amount of memory per vCPU, in GiB.

To specify no minimum limit, omit this parameter.

Link

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

MemoryMiBProperty

class CfnLaunchTemplate.MemoryMiBProperty(*, max=None, min=None)

Bases: object

The minimum and maximum amount of memory, in MiB.

Parameters
  • max (Union[int, float, None]) – The maximum amount of memory, in MiB. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum amount of memory, in MiB. To specify no minimum limit, specify 0 .

Link

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

ExampleMetadata

fixture=_generated

Example:

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

memory_mi_bProperty = ec2.CfnLaunchTemplate.MemoryMiBProperty(
    max=123,
    min=123
)

Attributes

max

The maximum amount of memory, in MiB.

To specify no maximum limit, omit this parameter.

Link

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

min

The minimum amount of memory, in MiB.

To specify no minimum limit, specify 0 .

Link

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

MetadataOptionsProperty

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

Bases: object

The metadata options for the instance.

For more information, see Instance metadata and user data in the Amazon EC2 User Guide .

MetadataOptions is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters
  • http_endpoint (Optional[str]) – 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_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 desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel. Default: 1 Possible values: Integers from 1 to 64

  • http_tokens (Optional[str]) – IMDSv2 uses token-backed sessions. Set the use of HTTP tokens to optional (in other words, set the use of IMDSv2 to optional ) or required (in other words, set the use of IMDSv2 to required ). - optional - When IMDSv2 is optional, you can choose to retrieve instance metadata with or without a session token in your request. If you retrieve the IAM role credentials without a token, the IMDSv1 role credentials are returned. If you retrieve the IAM role credentials using a valid session token, the IMDSv2 role credentials are returned. - required - When IMDSv2 is required, you must send a session token with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns IMDSv2 credentials; IMDSv1 credentials are not available. Default: optional

  • 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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-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.
import aws_cdk.aws_ec2 as ec2

metadata_options_property = ec2.CfnLaunchTemplate.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 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.
Link

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

http_protocol_ipv6

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

Default: disabled

Link

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

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

Possible values: Integers from 1 to 64

Link

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

http_tokens

IMDSv2 uses token-backed sessions.

Set the use of HTTP tokens to optional (in other words, set the use of IMDSv2 to optional ) or required (in other words, set the use of IMDSv2 to required ).

  • optional - When IMDSv2 is optional, you can choose to retrieve instance metadata with or without a session token in your request. If you retrieve the IAM role credentials without a token, the IMDSv1 role credentials are returned. If you retrieve the IAM role credentials using a valid session token, the IMDSv2 role credentials are returned.

  • required - When IMDSv2 is required, you must send a session token with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns IMDSv2 credentials; IMDSv1 credentials are not available.

Default: optional

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-metadataoptions.html#cfn-ec2-launchtemplate-launchtemplatedata-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

Link

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

MonitoringProperty

class CfnLaunchTemplate.MonitoringProperty(*, enabled=None)

Bases: object

Specifies whether detailed monitoring is enabled for an instance.

For more information about detailed monitoring, see Enable or turn off detailed monitoring for your instances in the Amazon EC2 User Guide .

Monitoring is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters

enabled (Union[bool, IResolvable, None]) – Specify true to enable detailed monitoring. Otherwise, basic monitoring is enabled.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-monitoring.html

ExampleMetadata

fixture=_generated

Example:

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

monitoring_property = ec2.CfnLaunchTemplate.MonitoringProperty(
    enabled=False
)

Attributes

enabled

Specify true to enable detailed monitoring.

Otherwise, basic monitoring is enabled.

Link

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

NetworkBandwidthGbpsProperty

class CfnLaunchTemplate.NetworkBandwidthGbpsProperty(*, max=None, min=None)

Bases: object

The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps).

Setting the minimum bandwidth does not guarantee that your instance will achieve the minimum bandwidth. Amazon EC2 will identify instance types that support the specified minimum bandwidth, but the actual bandwidth of your instance might go below the specified minimum at times. For more information, see Available instance bandwidth in the Amazon EC2 User Guide .

Parameters
  • max (Union[int, float, None]) – The maximum amount of network bandwidth, in Gbps. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum amount of network bandwidth, in Gbps. To specify no minimum limit, omit this parameter.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

network_bandwidth_gbps_property = ec2.CfnLaunchTemplate.NetworkBandwidthGbpsProperty(
    max=123,
    min=123
)

Attributes

max

The maximum amount of network bandwidth, in Gbps.

To specify no maximum limit, omit this parameter.

Link

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

min

The minimum amount of network bandwidth, in Gbps.

To specify no minimum limit, omit this parameter.

Link

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

NetworkInterfaceCountProperty

class CfnLaunchTemplate.NetworkInterfaceCountProperty(*, max=None, min=None)

Bases: object

The minimum and maximum number of network interfaces.

Parameters
  • max (Union[int, float, None]) – The maximum number of network interfaces. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum number of network interfaces. To specify no minimum limit, omit this parameter.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

network_interface_count_property = ec2.CfnLaunchTemplate.NetworkInterfaceCountProperty(
    max=123,
    min=123
)

Attributes

max

The maximum number of network interfaces.

To specify no maximum limit, omit this parameter.

Link

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

min

The minimum number of network interfaces.

To specify no minimum limit, omit this parameter.

Link

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

NetworkInterfaceProperty

class CfnLaunchTemplate.NetworkInterfaceProperty(*, associate_carrier_ip_address=None, associate_public_ip_address=None, delete_on_termination=None, description=None, device_index=None, groups=None, interface_type=None, ipv4_prefix_count=None, ipv4_prefixes=None, ipv6_address_count=None, ipv6_addresses=None, ipv6_prefix_count=None, ipv6_prefixes=None, network_card_index=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 the parameters for a network interface.

NetworkInterface is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters
  • associate_carrier_ip_address (Union[bool, IResolvable, None]) – Indicates whether to associate a Carrier IP address with eth0 for a new network interface. Use this option when you launch an instance in a Wavelength Zone and want to associate a Carrier IP address with the network interface. For more information about Carrier IP addresses, see Carrier IP addresses in the AWS Wavelength Developer Guide .

  • associate_public_ip_address (Union[bool, IResolvable, None]) – Associates a public IPv4 address with eth0 for a new network interface.

  • delete_on_termination (Union[bool, IResolvable, None]) – Indicates whether the network interface is deleted when the instance is terminated.

  • description (Optional[str]) – A description for the network interface.

  • device_index (Union[int, float, None]) – The device index for the network interface attachment.

  • groups (Optional[Sequence[str]]) – The IDs of one or more security groups.

  • interface_type (Optional[str]) – The type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide . If you are not creating an EFA, specify interface or omit this parameter. Valid values: interface | efa

  • ipv4_prefix_count (Union[int, float, None]) – The number of IPv4 prefixes to be automatically assigned to the network interface. You cannot use this option if you use the Ipv4Prefix option.

  • ipv4_prefixes (Union[IResolvable, Sequence[Union[IResolvable, Ipv4PrefixSpecificationProperty, Dict[str, Any]]], None]) – One or more IPv4 prefixes to be assigned to the network interface. You cannot use this option if you use the Ipv4PrefixCount option.

  • ipv6_address_count (Union[int, float, None]) – The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can’t use this option if specifying specific IPv6 addresses.

  • ipv6_addresses (Union[IResolvable, Sequence[Union[IResolvable, Ipv6AddProperty, Dict[str, Any]]], None]) – One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. You can’t use this option if you’re specifying a number of IPv6 addresses.

  • ipv6_prefix_count (Union[int, float, None]) – The number of IPv6 prefixes to be automatically assigned to the network interface. You cannot use this option if you use the Ipv6Prefix option.

  • ipv6_prefixes (Union[IResolvable, Sequence[Union[IResolvable, Ipv6PrefixSpecificationProperty, Dict[str, Any]]], None]) – One or more IPv6 prefixes to be assigned to the network interface. You cannot use this option if you use the Ipv6PrefixCount option.

  • network_card_index (Union[int, float, None]) – The index of the network card. Some instance types support multiple network cards. The primary network interface must be assigned to network card index 0. The default is network card index 0.

  • network_interface_id (Optional[str]) – The ID of the network interface.

  • private_ip_address (Optional[str]) – The primary private IPv4 address of the network interface.

  • private_ip_addresses (Union[IResolvable, Sequence[Union[IResolvable, PrivateIpAddProperty, Dict[str, Any]]], None]) – One or more private IPv4 addresses.

  • secondary_private_ip_address_count (Union[int, float, None]) – The number of secondary private IPv4 addresses to assign to a network interface.

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-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.
import aws_cdk.aws_ec2 as ec2

network_interface_property = ec2.CfnLaunchTemplate.NetworkInterfaceProperty(
    associate_carrier_ip_address=False,
    associate_public_ip_address=False,
    delete_on_termination=False,
    description="description",
    device_index=123,
    groups=["groups"],
    interface_type="interfaceType",
    ipv4_prefix_count=123,
    ipv4_prefixes=[ec2.CfnLaunchTemplate.Ipv4PrefixSpecificationProperty(
        ipv4_prefix="ipv4Prefix"
    )],
    ipv6_address_count=123,
    ipv6_addresses=[ec2.CfnLaunchTemplate.Ipv6AddProperty(
        ipv6_address="ipv6Address"
    )],
    ipv6_prefix_count=123,
    ipv6_prefixes=[ec2.CfnLaunchTemplate.Ipv6PrefixSpecificationProperty(
        ipv6_prefix="ipv6Prefix"
    )],
    network_card_index=123,
    network_interface_id="networkInterfaceId",
    private_ip_address="privateIpAddress",
    private_ip_addresses=[ec2.CfnLaunchTemplate.PrivateIpAddProperty(
        primary=False,
        private_ip_address="privateIpAddress"
    )],
    secondary_private_ip_address_count=123,
    subnet_id="subnetId"
)

Attributes

associate_carrier_ip_address

Indicates whether to associate a Carrier IP address with eth0 for a new network interface.

Use this option when you launch an instance in a Wavelength Zone and want to associate a Carrier IP address with the network interface. For more information about Carrier IP addresses, see Carrier IP addresses in the AWS Wavelength Developer Guide .

Link

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

associate_public_ip_address

Associates a public IPv4 address with eth0 for a new network interface.

Link

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

delete_on_termination

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

Link

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

description

A description for the network interface.

Link

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

device_index

The device index for the network interface attachment.

Link

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

groups

The IDs of one or more security groups.

Link

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

interface_type

The type of network interface.

To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide .

If you are not creating an EFA, specify interface or omit this parameter.

Valid values: interface | efa

Link

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

ipv4_prefix_count

The number of IPv4 prefixes to be automatically assigned to the network interface.

You cannot use this option if you use the Ipv4Prefix option.

Link

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

ipv4_prefixes

One or more IPv4 prefixes to be assigned to the network interface.

You cannot use this option if you use the Ipv4PrefixCount option.

Link

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

ipv6_address_count

The number of IPv6 addresses to assign to a network interface.

Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can’t use this option if specifying specific IPv6 addresses.

Link

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

ipv6_addresses

One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet.

You can’t use this option if you’re specifying a number of IPv6 addresses.

Link

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

ipv6_prefix_count

The number of IPv6 prefixes to be automatically assigned to the network interface.

You cannot use this option if you use the Ipv6Prefix option.

Link

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

ipv6_prefixes

One or more IPv6 prefixes to be assigned to the network interface.

You cannot use this option if you use the Ipv6PrefixCount option.

Link

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

network_card_index

The index of the network card.

Some instance types support multiple network cards. The primary network interface must be assigned to network card index 0. The default is network card index 0.

Link

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

network_interface_id

The ID of the network interface.

Link

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

private_ip_address

The primary private IPv4 address of the network interface.

Link

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

private_ip_addresses

One or more private IPv4 addresses.

Link

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

secondary_private_ip_address_count

The number of secondary private IPv4 addresses to assign to a network interface.

Link

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

subnet_id

The ID of the subnet for the network interface.

Link

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

PlacementProperty

class CfnLaunchTemplate.PlacementProperty(*, affinity=None, availability_zone=None, group_id=None, group_name=None, host_id=None, host_resource_group_arn=None, partition_number=None, spread_domain=None, tenancy=None)

Bases: object

Specifies the placement of an instance.

Placement is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters
  • affinity (Optional[str]) – The affinity setting for an instance on a Dedicated Host.

  • availability_zone (Optional[str]) – The Availability Zone for the instance.

  • group_id (Optional[str]) – The Group Id of a placement group. You must specify the Placement Group Group Id to launch an instance in a shared placement group.

  • group_name (Optional[str]) – The name of the placement group for the instance.

  • host_id (Optional[str]) – The ID of the Dedicated Host for the instance.

  • host_resource_group_arn (Optional[str]) – The ARN of the host resource group in which to launch the instances. If you specify a host resource group ARN, omit the Tenancy parameter or set it to host .

  • partition_number (Union[int, float, None]) – The number of the partition the instance should launch in. Valid only if the placement group strategy is set to partition .

  • spread_domain (Optional[str]) – Reserved for future use.

  • tenancy (Optional[str]) – The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-placement.html

ExampleMetadata

fixture=_generated

Example:

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

placement_property = ec2.CfnLaunchTemplate.PlacementProperty(
    affinity="affinity",
    availability_zone="availabilityZone",
    group_id="groupId",
    group_name="groupName",
    host_id="hostId",
    host_resource_group_arn="hostResourceGroupArn",
    partition_number=123,
    spread_domain="spreadDomain",
    tenancy="tenancy"
)

Attributes

affinity

The affinity setting for an instance on a Dedicated Host.

Link

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

availability_zone

The Availability Zone for the instance.

Link

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

group_id

The Group Id of a placement group.

You must specify the Placement Group Group Id to launch an instance in a shared placement group.

Link

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

group_name

The name of the placement group for the instance.

Link

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

host_id

The ID of the Dedicated Host for the instance.

Link

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

host_resource_group_arn

The ARN of the host resource group in which to launch the instances.

If you specify a host resource group ARN, omit the Tenancy parameter or set it to host .

Link

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

partition_number

The number of the partition the instance should launch in.

Valid only if the placement group strategy is set to partition .

Link

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

spread_domain

Reserved for future use.

Link

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

tenancy

The tenancy of the instance (if the instance is running in a VPC).

An instance with a tenancy of dedicated runs on single-tenant hardware.

Link

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

PrivateDnsNameOptionsProperty

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

Bases: object

Describes the options for instance hostnames.

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.

  • enable_resource_name_dns_a_record (Union[bool, IResolvable, None]) – Indicates whether to respond to DNS queries for instance hostnames with DNS A records.

  • hostname_type (Optional[str]) – The type of hostname for EC2 instances. 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 .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-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.
import aws_cdk.aws_ec2 as ec2

private_dns_name_options_property = ec2.CfnLaunchTemplate.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.

Link

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

enable_resource_name_dns_aaaa_record

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

Link

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

hostname_type

The type of hostname for EC2 instances.

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 .

Link

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

PrivateIpAddProperty

class CfnLaunchTemplate.PrivateIpAddProperty(*, primary=None, private_ip_address=None)

Bases: object

Specifies a secondary private IPv4 address for a network interface.

PrivateIpAdd is a property of AWS::EC2::LaunchTemplate NetworkInterface .

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.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

private_ip_add_property = ec2.CfnLaunchTemplate.PrivateIpAddProperty(
    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.

Link

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

private_ip_address

The private IPv4 address.

Link

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

SpotOptionsProperty

class CfnLaunchTemplate.SpotOptionsProperty(*, block_duration_minutes=None, instance_interruption_behavior=None, max_price=None, spot_instance_type=None, valid_until=None)

Bases: object

Specifies options for Spot Instances.

SpotOptions is a property of AWS::EC2::LaunchTemplate InstanceMarketOptions .

Parameters
  • block_duration_minutes (Union[int, float, None]) – Deprecated.

  • instance_interruption_behavior (Optional[str]) – The behavior when a Spot Instance is interrupted. The default is terminate .

  • max_price (Optional[str]) – The maximum hourly price you’re willing to pay for the Spot Instances. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price. .. epigraph:: If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter.

  • spot_instance_type (Optional[str]) – The Spot Instance request type. If you are using Spot Instances with an Auto Scaling group, use one-time requests, as the Amazon EC2 Auto Scaling service handles requesting new Spot Instances whenever the group is below its desired capacity.

  • valid_until (Optional[str]) – The end date of the request, in UTC format ( YYYY-MM-DD T HH:MM:SS Z). Supported only for persistent requests. - For a persistent request, the request remains active until the ValidUntil date and time is reached. Otherwise, the request remains active until you cancel it. - For a one-time request, ValidUntil is not supported. The request remains active until all instances launch or you cancel the request. Default: 7 days from the current date

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-instancemarketoptions-spotoptions.html

ExampleMetadata

fixture=_generated

Example:

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

spot_options_property = ec2.CfnLaunchTemplate.SpotOptionsProperty(
    block_duration_minutes=123,
    instance_interruption_behavior="instanceInterruptionBehavior",
    max_price="maxPrice",
    spot_instance_type="spotInstanceType",
    valid_until="validUntil"
)

Attributes

block_duration_minutes

Deprecated.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-instancemarketoptions-spotoptions.html#cfn-ec2-launchtemplate-launchtemplatedata-instancemarketoptions-spotoptions-blockdurationminutes

instance_interruption_behavior

The behavior when a Spot Instance is interrupted.

The default is terminate .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-instancemarketoptions-spotoptions.html#cfn-ec2-launchtemplate-launchtemplatedata-instancemarketoptions-spotoptions-instanceinterruptionbehavior

max_price

The maximum hourly price you’re willing to pay for the Spot Instances.

We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price. .. epigraph:

If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-instancemarketoptions-spotoptions.html#cfn-ec2-launchtemplate-launchtemplatedata-instancemarketoptions-spotoptions-maxprice

spot_instance_type

The Spot Instance request type.

If you are using Spot Instances with an Auto Scaling group, use one-time requests, as the Amazon EC2 Auto Scaling service handles requesting new Spot Instances whenever the group is below its desired capacity.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-instancemarketoptions-spotoptions.html#cfn-ec2-launchtemplate-launchtemplatedata-instancemarketoptions-spotoptions-spotinstancetype

valid_until

SS* Z). Supported only for persistent requests.

  • For a persistent request, the request remains active until the ValidUntil date and time is reached. Otherwise, the request remains active until you cancel it.

  • For a one-time request, ValidUntil is not supported. The request remains active until all instances launch or you cancel the request.

Default: 7 days from the current date

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-instancemarketoptions-spotoptions.html#cfn-ec2-launchtemplate-launchtemplatedata-instancemarketoptions-spotoptions-validuntil

Type

The end date of the request, in UTC format ( YYYY-MM-DD T *HH

Type

MM

TagSpecificationProperty

class CfnLaunchTemplate.TagSpecificationProperty(*, resource_type=None, tags=None)

Bases: object

Specifies the tags to apply to a resource when the resource is created for the launch template.

TagSpecification is a property type of `TagSpecifications <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-tagspecifications>`_ . `TagSpecifications <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html#cfn-ec2-launchtemplate-launchtemplatedata-tagspecifications>`_ is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Parameters
  • resource_type (Optional[str]) –

    The type of resource to tag. The Valid Values are all the resource types that can be tagged. However, when creating a launch template, you can specify tags for the following resource types only: instance | volume | elastic-gpu | network-interface | spot-instances-request To tag a resource after it has been created, see CreateTags .

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – The tags to apply to the resource.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

tag_specification_property = ec2.CfnLaunchTemplate.TagSpecificationProperty(
    resource_type="resourceType",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

resource_type

The type of resource to tag.

The Valid Values are all the resource types that can be tagged. However, when creating a launch template, you can specify tags for the following resource types only: instance | volume | elastic-gpu | network-interface | spot-instances-request

To tag a resource after it has been created, see CreateTags .

Link

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

tags

The tags to apply to the resource.

Link

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

TotalLocalStorageGBProperty

class CfnLaunchTemplate.TotalLocalStorageGBProperty(*, max=None, min=None)

Bases: object

The minimum and maximum amount of total local storage, in GB.

Parameters
  • max (Union[int, float, None]) – The maximum amount of total local storage, in GB. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum amount of total local storage, in GB. To specify no minimum limit, omit this parameter.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

total_local_storage_gBProperty = ec2.CfnLaunchTemplate.TotalLocalStorageGBProperty(
    max=123,
    min=123
)

Attributes

max

The maximum amount of total local storage, in GB.

To specify no maximum limit, omit this parameter.

Link

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

min

The minimum amount of total local storage, in GB.

To specify no minimum limit, omit this parameter.

Link

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

VCpuCountProperty

class CfnLaunchTemplate.VCpuCountProperty(*, max=None, min=None)

Bases: object

The minimum and maximum number of vCPUs.

Parameters
  • max (Union[int, float, None]) – The maximum number of vCPUs. To specify no maximum limit, omit this parameter.

  • min (Union[int, float, None]) – The minimum number of vCPUs. To specify no minimum limit, specify 0 .

Link

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

ExampleMetadata

fixture=_generated

Example:

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

v_cpu_count_property = ec2.CfnLaunchTemplate.VCpuCountProperty(
    max=123,
    min=123
)

Attributes

max

The maximum number of vCPUs.

To specify no maximum limit, omit this parameter.

Link

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

min

The minimum number of vCPUs.

To specify no minimum limit, specify 0 .

Link

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