CfnLaunchTemplate

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

Bases: aws_cdk.core.CfnResource

A CloudFormation AWS::EC2::LaunchTemplate.

Specifies a launch template for an Amazon EC2 instance. A launch template contains the parameters to launch an instance. For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

CloudformationResource

AWS::EC2::LaunchTemplate

ExampleMetadata

infused

Link

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

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

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

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.

Return type

None

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

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.

Return type

Any

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

Return type

str

attr_latest_version_number

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

CloudformationAttribute

LatestVersionNumber

Return type

str

cfn_options

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

Return type

ICfnResourceOptions

cfn_resource_type

AWS resource type.

Return type

str

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.

Return type

List[str]

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

Return type

Union[IResolvable, LaunchTemplateDataProperty, None]

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

Return type

Optional[str]

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).

Return type

str

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.

Return type

ConstructNode

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 }).

Return type

str

stack

The stack in which this element is defined.

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

Return type

Stack

tag_specifications

The tags to apply to the launch template during creation.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, LaunchTemplateTagSpecificationProperty]], None]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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

Return type

Optional[str]

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

Return type

Union[IResolvable, EbsProperty, None]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[IResolvable, CapacityReservationTargetProperty, None]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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 T2, T3, or T3a instance. Valid values are standard and 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 T2, T3, or T3a instance.

Valid values are standard and unlimited .

Link

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

Return type

Optional[str]

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

Return type

Union[bool, IResolvable, None]

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

Return type

Union[bool, IResolvable, None]

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

Return type

Union[int, float, None]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[bool, IResolvable, None]

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

Return type

Union[bool, IResolvable, None]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[IResolvable, SpotOptionsProperty, None]

InstanceRequirementsProperty

class CfnLaunchTemplate.InstanceRequirementsProperty(*, accelerator_count=None, accelerator_manufacturers=None, accelerator_names=None, accelerator_total_memory_mib=None, accelerator_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_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 parameters, you get instance types that satisfy all of the specified parameters. If you specify multiple values for a parameter, you get instance types that satisfy any of the specified values. .. epigraph:

You must specify ``VCpuCount`` and ``MemoryMiB`` . All other parameters are optional. Any unspecified optional parameter 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, 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 . Default: Any accelerator

  • accelerator_total_memory_mib (Union[IResolvable, AcceleratorTotalMemoryMiBProperty, 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

  • 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, 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. 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 (SDD) storage, specify sdd . Default: hdd and sdd

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

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

  • network_interface_count (Union[IResolvable, NetworkInterfaceCountProperty, 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 cheapest 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 cheapest 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, None]) – The minimum and maximum amount of total local storage, in GB. Default: No minimum or maximum limits

  • v_cpu_count (Union[IResolvable, VCpuCountProperty, 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"],
    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_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

Return type

Union[IResolvable, AcceleratorCountProperty, None]

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

Return type

Optional[List[str]]

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 .

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

Return type

Optional[List[str]]

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

Return type

Union[IResolvable, AcceleratorTotalMemoryMiBProperty, None]

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

Return type

Optional[List[str]]

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

Return type

Optional[str]

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

Return type

Union[IResolvable, BaselineEbsBandwidthMbpsProperty, None]

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

Return type

Optional[str]

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

Return type

Optional[List[str]]

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.

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

Return type

Optional[List[str]]

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

Return type

Optional[List[str]]

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

Return type

Optional[str]

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 (SDD) storage, specify sdd .

Default: hdd and sdd

Link

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

Return type

Optional[List[str]]

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

Return type

Union[IResolvable, MemoryGiBPerVCpuProperty, None]

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

Return type

Union[IResolvable, MemoryMiBProperty, None]

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

Return type

Union[IResolvable, NetworkInterfaceCountProperty, None]

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

Return type

Union[int, float, None]

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

Return type

Union[bool, IResolvable, None]

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

Return type

Union[int, float, None]

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

Return type

Union[IResolvable, TotalLocalStorageGBProperty, None]

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

Return type

Union[IResolvable, VCpuCountProperty, None]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Optional[str]

LaunchTemplateDataProperty

class CfnLaunchTemplate.LaunchTemplateDataProperty(*, block_device_mappings=None, capacity_reservation_specification=None, cpu_options=None, credit_specification=None, disable_api_termination=None, ebs_optimized=None, elastic_gpu_specifications=None, elastic_inference_accelerators=None, enclave_options=None, hibernation_options=None, 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]], None]) – The block device mapping.

  • capacity_reservation_specification (Union[IResolvable, CapacityReservationSpecificationProperty, 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, 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, None]) – The credit option for CPU usage of the instance. Valid for T2, T3, or T3a instances only.

  • 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]], None]) – An elastic GPU to associate with the instance.

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

  • enclave_options (Union[IResolvable, EnclaveOptionsProperty, 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, 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, None]) – The name or Amazon Resource Name (ARN) of an IAM instance profile.

  • image_id (Optional[str]) – The ID of the AMI.

  • 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, None]) – The market (purchasing) option for the instances.

  • instance_requirements (Union[IResolvable, InstanceRequirementsProperty, 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 InstanceTypes .

  • instance_type (Optional[str]) –

    The instance type. For more information, see Instance types in the Amazon Elastic Compute Cloud User Guide . If you specify InstanceTypes , 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]], None]) – The license configurations.

  • maintenance_options (Union[IResolvable, MaintenanceOptionsProperty, None]) – CfnLaunchTemplate.LaunchTemplateDataProperty.MaintenanceOptions.

  • metadata_options (Union[IResolvable, MetadataOptionsProperty, 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, None]) – The monitoring for the instance.

  • network_interfaces (Union[IResolvable, Sequence[Union[IResolvable, NetworkInterfaceProperty]], 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, None]) – The placement for the instance.

  • private_dns_name_options (Union[IResolvable, PrivateDnsNameOptionsProperty, 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]]) – [EC2-Classic, default VPC] 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]], None]) – The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch.

  • 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_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"],
        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_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_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

Return type

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

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

Return type

Union[IResolvable, CapacityReservationSpecificationProperty, None]

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

Return type

Union[IResolvable, CpuOptionsProperty, None]

credit_specification

The credit option for CPU usage of the instance.

Valid for T2, T3, or T3a instances only.

Link

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

Return type

Union[IResolvable, CreditSpecificationProperty, None]

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

Return type

Union[bool, IResolvable, None]

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

Return type

Union[bool, IResolvable, None]

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

Return type

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

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

Return type

Union[IResolvable, List[Union[IResolvable, LaunchTemplateElasticInferenceAcceleratorProperty]], None]

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

Return type

Union[IResolvable, EnclaveOptionsProperty, None]

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

Return type

Union[IResolvable, HibernationOptionsProperty, None]

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

Return type

Union[IResolvable, IamInstanceProfileProperty, None]

image_id

The ID of the AMI.

Link

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[IResolvable, InstanceMarketOptionsProperty, None]

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 InstanceTypes .

Link

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

Return type

Union[IResolvable, InstanceRequirementsProperty, None]

instance_type

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

If you specify InstanceTypes , 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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

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

maintenance_options

CfnLaunchTemplate.LaunchTemplateDataProperty.MaintenanceOptions.

Link

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

Return type

Union[IResolvable, MaintenanceOptionsProperty, None]

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

Return type

Union[IResolvable, MetadataOptionsProperty, None]

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

Return type

Union[IResolvable, MonitoringProperty, None]

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

Return type

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

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

Return type

Union[IResolvable, PlacementProperty, None]

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

Return type

Union[IResolvable, PrivateDnsNameOptionsProperty, None]

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

Return type

Optional[str]

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

Return type

Optional[List[str]]

security_groups

[EC2-Classic, default VPC] 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

Return type

Optional[List[str]]

tag_specifications

The tags to apply to the resources during launch.

You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, TagSpecificationProperty]], None]

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

Return type

Optional[str]

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

Return type

Union[int, float, None]

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

Return type

Optional[str]

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[CfnTag]]) – 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

Return type

Optional[str]

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

Return type

Optional[List[CfnTag]]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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

Specifies the metadata options for the instance.

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]) – The state of token usage for your instance metadata requests. If the parameter is not specified in the request, the default state is optional . If the state is optional , you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role credentials are returned. If the state is required , you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the version 1.0 credentials are not available.

  • 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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[int, float, None]

http_tokens

The state of token usage for your instance metadata requests.

If the parameter is not specified in the request, the default state is optional .

If the state is optional , you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role credentials are returned.

If the state is required , you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the version 1.0 credentials are not available.

Link

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[bool, IResolvable, None]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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]], 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]], 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]], 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]], 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

Return type

Union[bool, IResolvable, None]

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

Return type

Union[bool, IResolvable, None]

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

Return type

Union[bool, IResolvable, None]

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

Return type

Optional[str]

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

Return type

Union[int, float, None]

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

Return type

Optional[List[str]]

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

Return type

Optional[str]

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

Return type

Union[int, float, None]

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

Return type

Union[IResolvable, List[Union[IResolvable, Ipv4PrefixSpecificationProperty]], None]

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

Return type

Union[int, float, None]

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

Return type

Union[IResolvable, List[Union[IResolvable, Ipv6AddProperty]], None]

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

Return type

Union[int, float, None]

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

Return type

Union[IResolvable, List[Union[IResolvable, Ipv6PrefixSpecificationProperty]], None]

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

Return type

Union[int, float, None]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[IResolvable, List[Union[IResolvable, PrivateIpAddProperty]], None]

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

Return type

Union[int, float, None]

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

Return type

Optional[str]

PlacementProperty

class CfnLaunchTemplate.PlacementProperty(*, affinity=None, availability_zone=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_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_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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[int, float, None]

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

Return type

Optional[str]

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

Return type

Optional[str]

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

Return type

Union[bool, IResolvable, None]

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

Return type

Union[bool, IResolvable, None]

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

Return type

Optional[str]

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 addresses.

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

Return type

Union[bool, IResolvable, None]

private_ip_address

The private IPv4 addresses.

Link

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

Return type

Optional[str]

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]) – The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).

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

  • 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. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. The default end date is 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

The required duration for the Spot Instances (also known as Spot blocks), in minutes.

This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).

Link

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

Return type

Union[int, float, None]

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

Return type

Optional[str]

max_price

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

Link

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

Return type

Optional[str]

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

Return type

Optional[str]

valid_until

The end date of the request.

For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. The default end date is 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

Return type

Optional[str]

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. Currently, the resource types that support tagging on creation are instance and volume . To tag a resource after it has been created, see CreateTags . Conditional : Required if tags are set.

  • tags (Optional[Sequence[CfnTag]]) – 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.

Currently, the resource types that support tagging on creation are instance and volume . To tag a resource after it has been created, see CreateTags .

Conditional : Required if tags are set.

Link

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

Return type

Optional[str]

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

Return type

Optional[List[CfnTag]]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]

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

Return type

Union[int, float, None]