CfnLaunchTemplate

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

Bases: CfnResource

Specifies the properties for creating a launch template.

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

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

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

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

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

See:

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

CloudformationResource:

AWS::EC2::LaunchTemplate

ExampleMetadata:

infused

Example:

# cluster: eks.Cluster


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

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

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

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

cluster.add_nodegroup_capacity("extra-ng",
    launch_template_spec=eks.LaunchTemplateSpec(
        id=lt.ref,
        version=lt.attr_latest_version_number
    )
)
Parameters:
  • scope (Construct) – Scope in which this resource is defined.

  • id (str) – Construct identifier for this resource (unique in its scope).

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

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

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

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

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters:

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

Return type:

None

add_dependency(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_depends_on(target)

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

Parameters:

target (CfnResource) –

Deprecated:

use addDependency

Stability:

deprecated

Return type:

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters:
  • key (str) –

  • value (Any) –

See:

Return type:

None

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

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

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

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

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

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

For example:

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

would add the overrides Example:

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

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

Parameters:
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermediate 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). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

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 resource, please consult that specific resource’s documentation.

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options

Return type:

None

get_att(attribute_name, type_hint=None)

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.

  • type_hint (Optional[ResolutionTypeHint]) –

Return type:

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters:

key (str) –

See:

Return type:

Any

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

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

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters:

inspector (TreeInspector) – tree inspector to collect and process attributes.

Return type:

None

obtain_dependencies()

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.

Return type:

List[Union[Stack, CfnResource]]

obtain_resource_dependencies()

Get a shallow copy of dependencies between this resource and other resources in the same stack.

Return type:

List[CfnResource]

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

remove_dependency(target)

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

replace_dependency(target, new_target)

Replaces one dependency with another.

Parameters:
Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Returns:

a string representation of this resource

Attributes

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

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

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

CloudformationAttribute:

DefaultVersionNumber

attr_latest_version_number

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

CloudformationAttribute:

LatestVersionNumber

attr_launch_template_id

The ID of the launch template.

CloudformationAttribute:

LaunchTemplateId

cfn_options

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

cfn_resource_type

AWS resource type.

creation_stack

return:

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

launch_template_data

The information for the launch template.

launch_template_name

A name for the launch template.

logical_id

The logical ID for this CloudFormation stack element.

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

To override this value, use overrideLogicalId(newLogicalId).

Returns:

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

node

The tree node.

ref

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

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

stack

The stack in which this element is defined.

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

tag_specifications

The tags to apply to the launch template on creation.

version_description

A description for the first version of the launch template.

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(x)

Check whether the given object is a CfnResource.

Parameters:

x (Any) –

Return type:

bool

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

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

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.

See:

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.
from aws_cdk import 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 .

See:

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

min

The minimum number of accelerators.

To specify no minimum limit, omit this parameter.

See:

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

AcceleratorTotalMemoryMiBProperty

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

Bases: object

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

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

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

See:

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.
from aws_cdk import 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.

See:

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

min

The minimum amount of accelerator memory, in MiB.

To specify no minimum limit, omit this parameter.

See:

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

BaselineEbsBandwidthMbpsProperty

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

Bases: object

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

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

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

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

See:

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.
from aws_cdk import 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.

See:

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

min

The minimum baseline bandwidth, in Mbps.

To specify no minimum limit, omit this parameter.

See:

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

BlockDeviceMappingProperty

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

Bases: object

Specifies a block device mapping for a launch template.

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

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

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

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

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

  • virtual_name (Optional[str]) – The virtual device name (ephemeralN). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1. The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

See:

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.
from aws_cdk import 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).

See:

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

ebs

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

See:

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

no_device

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

See:

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

virtual_name

The virtual device name (ephemeralN).

Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1. The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

See:

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

CapacityReservationSpecificationProperty

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

Bases: object

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

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

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

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

See:

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

See:

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

Type:

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

capacity_reservation_target

Information about the target Capacity Reservation or Capacity Reservation group.

See:

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

CapacityReservationTargetProperty

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

Bases: object

Specifies a target Capacity Reservation.

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

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

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

See:

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.
from aws_cdk import 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.

See:

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

capacity_reservation_resource_group_arn

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

See:

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

ConnectionTrackingSpecificationProperty

class CfnLaunchTemplate.ConnectionTrackingSpecificationProperty(*, tcp_established_timeout=None, udp_stream_timeout=None, udp_timeout=None)

Bases: object

A security group connection tracking specification that enables you to set the idle timeout for connection tracking on an Elastic network interface.

For more information, see Connection tracking timeouts in the Amazon Elastic Compute Cloud User Guide .

Parameters:
  • tcp_established_timeout (Union[int, float, None]) – Timeout (in seconds) for idle TCP connections in an established state. Min: 60 seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: Less than 432000 seconds.

  • udp_stream_timeout (Union[int, float, None]) – Timeout (in seconds) for idle UDP flows classified as streams which have seen more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 minutes). Default: 180 seconds.

  • udp_timeout (Union[int, float, None]) – Timeout (in seconds) for idle UDP flows that have seen traffic only in a single direction or a single request-response transaction. Min: 30 seconds. Max: 60 seconds. Default: 30 seconds.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

connection_tracking_specification_property = ec2.CfnLaunchTemplate.ConnectionTrackingSpecificationProperty(
    tcp_established_timeout=123,
    udp_stream_timeout=123,
    udp_timeout=123
)

Attributes

tcp_established_timeout

Timeout (in seconds) for idle TCP connections in an established state.

Min: 60 seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: Less than 432000 seconds.

See:

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

udp_stream_timeout

Timeout (in seconds) for idle UDP flows classified as streams which have seen more than one request-response transaction.

Min: 60 seconds. Max: 180 seconds (3 minutes). Default: 180 seconds.

See:

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

udp_timeout

Timeout (in seconds) for idle UDP flows that have seen traffic only in a single direction or a single request-response transaction.

Min: 30 seconds. Max: 60 seconds. Default: 30 seconds.

See:

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

CpuOptionsProperty

class CfnLaunchTemplate.CpuOptionsProperty(*, amd_sev_snp=None, 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:
  • amd_sev_snp (Optional[str]) – Indicates whether to enable the instance for AMD SEV-SNP. AMD SEV-SNP is supported with M6a, R6a, and C6a instance types only. For more information, see AMD SEV-SNP .

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

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

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

Attributes

amd_sev_snp

Indicates whether to enable the instance for AMD SEV-SNP.

AMD SEV-SNP is supported with M6a, R6a, and C6a instance types only. For more information, see AMD SEV-SNP .

See:

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

core_count

The number of CPU cores for the instance.

See:

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

threads_per_core

The number of threads per CPU core.

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

See:

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

CreditSpecificationProperty

class CfnLaunchTemplate.CreditSpecificationProperty(*, cpu_credits=None)

Bases: object

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

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

Parameters:

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

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

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

Attributes

cpu_credits

The credit option for CPU usage of a T instance.

Valid values: standard | unlimited

See:

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

EbsProperty

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

Bases: object

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

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

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

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

  • iops (Union[int, float, None]) – The number of I/O operations per second (IOPS). For gp3 , io1 , and io2 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. The following are the supported values for each volume type: - gp3 : 3,000 - 16,000 IOPS - io1 : 100 - 64,000 IOPS - io2 : 100 - 256,000 IOPS For io2 volumes, you can achieve up to 256,000 IOPS on instances built on the Nitro System . On other instances, you can achieve performance up to 32,000 IOPS. This parameter is supported for io1 , io2 , and gp3 volumes only.

  • 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 GiB - io1 : 4 - 16,384 GiB - io2 : 4 - 65,536 GiB - st1 and sc1 : 125 - 16,384 GiB - standard : 1 - 1024 GiB

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

See:

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

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import 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.

See:

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

encrypted

Indicates whether the EBS volume is encrypted.

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

See:

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

iops

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

For gp3 , io1 , and io2 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.

The following are the supported values for each volume type:

  • gp3 : 3,000 - 16,000 IOPS

  • io1 : 100 - 64,000 IOPS

  • io2 : 100 - 256,000 IOPS

For io2 volumes, you can achieve up to 256,000 IOPS on instances built on the Nitro System . On other instances, you can achieve performance up to 32,000 IOPS.

This parameter is supported for io1 , io2 , and gp3 volumes only.

See:

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

kms_key_id

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

See:

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

snapshot_id

The ID of the snapshot.

See:

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

throughput

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

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

See:

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

volume_size

The size of the volume, in GiBs.

You must specify either a snapshot ID or a volume size. The following are the supported volumes sizes for each volume type:

  • gp2 and gp3 : 1 - 16,384 GiB

  • io1 : 4 - 16,384 GiB

  • io2 : 4 - 65,536 GiB

  • st1 and sc1 : 125 - 16,384 GiB

  • standard : 1 - 1024 GiB

See:

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

volume_type

The volume type.

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

See:

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

ElasticGpuSpecificationProperty

class CfnLaunchTemplate.ElasticGpuSpecificationProperty(*, type=None)

Bases: object

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

For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.

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

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

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 .

See:

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

EnaSrdSpecificationProperty

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

Bases: object

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

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

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

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

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

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

ena_srd_specification_property = ec2.CfnLaunchTemplate.EnaSrdSpecificationProperty(
    ena_srd_enabled=False,
    ena_srd_udp_specification=ec2.CfnLaunchTemplate.EnaSrdUdpSpecificationProperty(
        ena_srd_udp_enabled=False
    )
)

Attributes

ena_srd_enabled

Indicates whether ENA Express is enabled for the network interface.

See:

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

ena_srd_udp_specification

Configures ENA Express for UDP network traffic.

See:

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

EnaSrdUdpSpecificationProperty

class CfnLaunchTemplate.EnaSrdUdpSpecificationProperty(*, ena_srd_udp_enabled=None)

Bases: object

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

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

Parameters:

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

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

ena_srd_udp_specification_property = ec2.CfnLaunchTemplate.EnaSrdUdpSpecificationProperty(
    ena_srd_udp_enabled=False
)

Attributes

ena_srd_udp_enabled

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

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

See:

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

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.

See:

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

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import 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.

See:

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

HibernationOptionsProperty

class CfnLaunchTemplate.HibernationOptionsProperty(*, configured=None)

Bases: object

Specifies whether your instance is configured for hibernation.

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

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

Parameters:

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

See:

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

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import 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

See:

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

IamInstanceProfileProperty

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

Bases: object

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

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

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

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

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

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

See:

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

See:

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

name

The name of the instance profile.

See:

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

InstanceMarketOptionsProperty

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

Bases: object

Specifies the market (purchasing) option for an instance.

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

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

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

See:

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

See:

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

spot_options

The options for Spot Instances.

See:

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

InstanceRequirementsProperty

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

Bases: object

The attributes for the instance types.

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

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

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

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

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

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

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

Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to use the launch template in the launch instance wizard , or with the RunInstances API or AWS::EC2::Instance AWS CloudFormation resource, you can’t specify InstanceRequirements .

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

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

  • accelerator_manufacturers (Optional[Sequence[str]]) – Indicates whether instance types must have accelerators by specific manufacturers. - For instance types with AWS devices, specify amazon-web-services . - For instance types with AMD devices, specify amd . - For instance types with Habana devices, specify habana . - For instance types with NVIDIA devices, specify nvidia . - 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 A10G GPUs, specify a10g . - For instance types with NVIDIA A100 GPUs, specify a100 . - For instance types with NVIDIA H100 GPUs, specify h100 . - For instance types with AWS Inferentia chips, specify inferentia . - For instance types with NVIDIA GRID K520 GPUs, specify k520 . - For instance types with NVIDIA K80 GPUs, specify k80 . - 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 NVIDIA T4 GPUs, specify t4 . - For instance types with NVIDIA T4G GPUs, specify t4g . - For instance types with Xilinx VU9P FPGAs, specify vu9p . - For instance types with NVIDIA V100 GPUs, specify v100 . Default: Any accelerator

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

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

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

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

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

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

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

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

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

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

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

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

  • max_spot_price_as_percentage_of_optimal_on_demand_price (Union[int, float, None]) – [Price protection] The price protection threshold for Spot Instances, as a percentage of an identified On-Demand price. The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified price is from the lowest priced current generation instance types, and failing that, from the lowest priced previous generation instance types that match your attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose price exceeds your specified threshold. The parameter accepts an integer, which Amazon EC2 interprets as a percentage. If you set DesiredCapacityType to vcpu or memory-mib , the price protection threshold is based on the per vCPU or per memory price instead of the per instance price. .. epigraph:: Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don’t specify either, Amazon EC2 will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as 999999 .

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

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

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

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

  • on_demand_max_price_percentage_over_lowest_price (Union[int, float, None]) – [Price protection] The price protection threshold for On-Demand Instances, as a percentage higher than an identified On-Demand price. The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose price exceeds your specified 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]) –

    [Price protection] The price protection threshold for Spot Instances, as a percentage higher than an identified Spot price. The identified Spot price is the Spot price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified Spot price is from the lowest priced current generation instance types, and failing that, from the lowest priced previous generation instance types that match your attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose Spot price exceeds your specified threshold. The parameter accepts an integer, which Amazon EC2 interprets as a percentage. 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. This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements . .. epigraph:: Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don’t specify either, Amazon EC2 will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as 999999 . Default: 100

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

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

See:

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

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

Attributes

accelerator_count

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

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

Default: No minimum or maximum limits

See:

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

accelerator_manufacturers

Indicates whether instance types must have accelerators by specific manufacturers.

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

  • For instance types with AMD devices, specify amd .

  • For instance types with Habana devices, specify habana .

  • For instance types with NVIDIA devices, specify nvidia .

  • For instance types with Xilinx devices, specify xilinx .

Default: Any manufacturer

See:

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

accelerator_names

The accelerators that must be on the instance type.

  • For instance types with NVIDIA A10G GPUs, specify a10g .

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

  • For instance types with NVIDIA H100 GPUs, specify h100 .

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

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

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

  • 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 NVIDIA T4 GPUs, specify t4 .

  • For instance types with NVIDIA T4G GPUs, specify t4g .

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

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

Default: Any accelerator

See:

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

accelerator_total_memory_mib

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

Default: No minimum or maximum limits

See:

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

accelerator_types

The accelerator types that must be on the instance type.

  • For instance types with GPU accelerators, specify gpu .

  • For instance types with FPGA accelerators, specify fpga .

  • For instance types with inference accelerators, specify inference .

Default: Any accelerator type

See:

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

allowed_instance_types

The instance types to apply your specified attributes against.

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

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

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

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

Default: All instance types

See:

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

bare_metal

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

  • To include bare metal instance types, specify included .

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

  • To exclude bare metal instance types, specify excluded .

Default: excluded

See:

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

baseline_ebs_bandwidth_mbps

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

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

Default: No minimum or maximum limits

See:

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

burstable_performance

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

For more information, see Burstable performance instances .

  • To include burstable performance instance types, specify included .

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

  • To exclude burstable performance instance types, specify excluded .

Default: excluded

See:

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

cpu_manufacturers

The CPU manufacturers to include.

  • For instance types with Intel CPUs, specify intel .

  • For instance types with AMD CPUs, specify amd .

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

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

Default: Any manufacturer

See:

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

excluded_instance_types

The instance types to exclude.

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

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

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

Default: No excluded instance types

See:

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

instance_generations

Indicates whether current or previous generation instance types are included.

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

For current generation instance types, specify current .

For previous generation instance types, specify previous .

Default: Current and previous generation instance types

See:

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

local_storage

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

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

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

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

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

Default: included

See:

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

local_storage_types

The type of local storage that is required.

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

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

Default: hdd and ssd

See:

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

max_spot_price_as_percentage_of_optimal_on_demand_price

[Price protection] The price protection threshold for Spot Instances, as a percentage of an identified On-Demand price.

The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified price is from the lowest priced current generation instance types, and failing that, from the lowest priced previous generation instance types that match your attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose price exceeds your specified threshold.

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

If you set DesiredCapacityType to vcpu or memory-mib , the price protection threshold is based on the per vCPU or per memory price instead of the per instance price. .. epigraph:

Only one of ``SpotMaxPricePercentageOverLowestPrice`` or ``MaxSpotPriceAsPercentageOfOptimalOnDemandPrice`` can be specified. If you don't specify either, Amazon EC2 will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as ``999999`` .
See:

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

memory_gib_per_v_cpu

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

Default: No minimum or maximum limits

See:

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

memory_mib

The minimum and maximum amount of memory, in MiB.

See:

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

network_bandwidth_gbps

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

Default: No minimum or maximum limits

See:

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

network_interface_count

The minimum and maximum number of network interfaces.

Default: No minimum or maximum limits

See:

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

on_demand_max_price_percentage_over_lowest_price

[Price protection] The price protection threshold for On-Demand Instances, as a percentage higher than an identified On-Demand price.

The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose price exceeds your specified 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

See:

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

require_hibernate_support

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

This parameter is not supported for GetSpotPlacementScores .

Default: false

See:

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

spot_max_price_percentage_over_lowest_price

[Price protection] The price protection threshold for Spot Instances, as a percentage higher than an identified Spot price.

The identified Spot price is the Spot price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified Spot price is from the lowest priced current generation instance types, and failing that, from the lowest priced previous generation instance types that match your attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose Spot price exceeds your specified threshold.

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

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.

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

Only one of ``SpotMaxPricePercentageOverLowestPrice`` or ``MaxSpotPriceAsPercentageOfOptimalOnDemandPrice`` can be specified. If you don't specify either, Amazon EC2 will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as ``999999`` .

Default: 100

See:

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

total_local_storage_gb

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

Default: No minimum or maximum limits

See:

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

v_cpu_count

The minimum and maximum number of vCPUs.

See:

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

Ipv4PrefixSpecificationProperty

class CfnLaunchTemplate.Ipv4PrefixSpecificationProperty(*, ipv4_prefix=None)

Bases: object

Specifies an IPv4 prefix for a network interface.

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

Parameters:

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

See:

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.
from aws_cdk import 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 .

See:

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

Ipv6AddProperty

class CfnLaunchTemplate.Ipv6AddProperty(*, ipv6_address=None)

Bases: object

Specifies an IPv6 address in an Amazon EC2 launch template.

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

Parameters:

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

See:

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.
from aws_cdk import 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.

See:

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

Ipv6PrefixSpecificationProperty

class CfnLaunchTemplate.Ipv6PrefixSpecificationProperty(*, ipv6_prefix=None)

Bases: object

Specifies an IPv6 prefix for a network interface.

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

Parameters:

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

See:

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.
from aws_cdk import aws_ec2 as ec2

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

Attributes

ipv6_prefix

The IPv6 prefix.

See:

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

LaunchTemplateDataProperty

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

Bases: object

The information to include in the launch template.

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

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

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

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

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

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

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

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

  • elastic_gpu_specifications (Union[IResolvable, Sequence[Union[IResolvable, ElasticGpuSpecificationProperty, Dict[str, Any]]], None]) – Deprecated. .. epigraph:: Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.

  • elastic_inference_accelerators (Union[IResolvable, Sequence[Union[IResolvable, LaunchTemplateElasticInferenceAcceleratorProperty, Dict[str, Any]]], None]) – An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads. You cannot specify accelerators from different generations in the same request. .. epigraph:: Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.

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

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

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

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

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

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

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

  • instance_requirements (Union[IResolvable, InstanceRequirementsProperty, Dict[str, Any], None]) –

    The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with these attributes. You must specify VCpuCount and MemoryMiB . All other attributes are optional. Any unspecified optional attribute is set to its default. When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values. To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request: - AllowedInstanceTypes - The instance types to include in the list. All other instance types are ignored, even if they match your specified attributes. - ExcludedInstanceTypes - The instance types to exclude from the list, even if they match your specified attributes. .. epigraph:: If you specify InstanceRequirements , you can’t specify InstanceType . Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to use the launch template in the launch instance wizard , or with the RunInstances API or AWS::EC2::Instance AWS CloudFormation resource, you can’t specify InstanceRequirements . 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 .

  • instance_type (Optional[str]) –

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

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

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

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

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

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

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

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

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

  • private_dns_name_options (Union[IResolvable, PrivateDnsNameOptionsProperty, Dict[str, Any], None]) – The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled. For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .

  • 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]]) – The IDs of the security groups. You can specify the IDs of existing security groups and references to resources created by the stack template.

  • security_groups (Optional[Sequence[str]]) – One or more security group names. For a nondefault VPC, you must use security group IDs instead.

  • tag_specifications (Union[IResolvable, Sequence[Union[IResolvable, TagSpecificationProperty, Dict[str, Any]]], None]) –

    The tags to apply to the resources that are created during instance launch. To tag a resource after it has been created, see CreateTags . To tag the launch template itself, use TagSpecifications .

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

See:

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.
from aws_cdk import 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(
        amd_sev_snp="amdSevSnp",
        core_count=123,
        threads_per_core=123
    ),
    credit_specification=ec2.CfnLaunchTemplate.CreditSpecificationProperty(
        cpu_credits="cpuCredits"
    ),
    disable_api_stop=False,
    disable_api_termination=False,
    ebs_optimized=False,
    elastic_gpu_specifications=[ec2.CfnLaunchTemplate.ElasticGpuSpecificationProperty(
        type="type"
    )],
    elastic_inference_accelerators=[ec2.CfnLaunchTemplate.LaunchTemplateElasticInferenceAcceleratorProperty(
        count=123,
        type="type"
    )],
    enclave_options=ec2.CfnLaunchTemplate.EnclaveOptionsProperty(
        enabled=False
    ),
    hibernation_options=ec2.CfnLaunchTemplate.HibernationOptionsProperty(
        configured=False
    ),
    iam_instance_profile=ec2.CfnLaunchTemplate.IamInstanceProfileProperty(
        arn="arn",
        name="name"
    ),
    image_id="imageId",
    instance_initiated_shutdown_behavior="instanceInitiatedShutdownBehavior",
    instance_market_options=ec2.CfnLaunchTemplate.InstanceMarketOptionsProperty(
        market_type="marketType",
        spot_options=ec2.CfnLaunchTemplate.SpotOptionsProperty(
            block_duration_minutes=123,
            instance_interruption_behavior="instanceInterruptionBehavior",
            max_price="maxPrice",
            spot_instance_type="spotInstanceType",
            valid_until="validUntil"
        )
    ),
    instance_requirements=ec2.CfnLaunchTemplate.InstanceRequirementsProperty(
        accelerator_count=ec2.CfnLaunchTemplate.AcceleratorCountProperty(
            max=123,
            min=123
        ),
        accelerator_manufacturers=["acceleratorManufacturers"],
        accelerator_names=["acceleratorNames"],
        accelerator_total_memory_mi_b=ec2.CfnLaunchTemplate.AcceleratorTotalMemoryMiBProperty(
            max=123,
            min=123
        ),
        accelerator_types=["acceleratorTypes"],
        allowed_instance_types=["allowedInstanceTypes"],
        bare_metal="bareMetal",
        baseline_ebs_bandwidth_mbps=ec2.CfnLaunchTemplate.BaselineEbsBandwidthMbpsProperty(
            max=123,
            min=123
        ),
        burstable_performance="burstablePerformance",
        cpu_manufacturers=["cpuManufacturers"],
        excluded_instance_types=["excludedInstanceTypes"],
        instance_generations=["instanceGenerations"],
        local_storage="localStorage",
        local_storage_types=["localStorageTypes"],
        max_spot_price_as_percentage_of_optimal_on_demand_price=123,
        memory_gi_bPer_vCpu=ec2.CfnLaunchTemplate.MemoryGiBPerVCpuProperty(
            max=123,
            min=123
        ),
        memory_mi_b=ec2.CfnLaunchTemplate.MemoryMiBProperty(
            max=123,
            min=123
        ),
        network_bandwidth_gbps=ec2.CfnLaunchTemplate.NetworkBandwidthGbpsProperty(
            max=123,
            min=123
        ),
        network_interface_count=ec2.CfnLaunchTemplate.NetworkInterfaceCountProperty(
            max=123,
            min=123
        ),
        on_demand_max_price_percentage_over_lowest_price=123,
        require_hibernate_support=False,
        spot_max_price_percentage_over_lowest_price=123,
        total_local_storage_gb=ec2.CfnLaunchTemplate.TotalLocalStorageGBProperty(
            max=123,
            min=123
        ),
        v_cpu_count=ec2.CfnLaunchTemplate.VCpuCountProperty(
            max=123,
            min=123
        )
    ),
    instance_type="instanceType",
    kernel_id="kernelId",
    key_name="keyName",
    license_specifications=[ec2.CfnLaunchTemplate.LicenseSpecificationProperty(
        license_configuration_arn="licenseConfigurationArn"
    )],
    maintenance_options=ec2.CfnLaunchTemplate.MaintenanceOptionsProperty(
        auto_recovery="autoRecovery",
        reboot_migration="rebootMigration"
    ),
    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,
        connection_tracking_specification=ec2.CfnLaunchTemplate.ConnectionTrackingSpecificationProperty(
            tcp_established_timeout=123,
            udp_stream_timeout=123,
            udp_timeout=123
        ),
        delete_on_termination=False,
        description="description",
        device_index=123,
        ena_srd_specification=ec2.CfnLaunchTemplate.EnaSrdSpecificationProperty(
            ena_srd_enabled=False,
            ena_srd_udp_specification=ec2.CfnLaunchTemplate.EnaSrdUdpSpecificationProperty(
                ena_srd_udp_enabled=False
            )
        ),
        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",
        primary_ipv6=False,
        private_ip_address="privateIpAddress",
        private_ip_addresses=[ec2.CfnLaunchTemplate.PrivateIpAddProperty(
            primary=False,
            private_ip_address="privateIpAddress"
        )],
        secondary_private_ip_address_count=123,
        subnet_id="subnetId"
    )],
    placement=ec2.CfnLaunchTemplate.PlacementProperty(
        affinity="affinity",
        availability_zone="availabilityZone",
        group_id="groupId",
        group_name="groupName",
        host_id="hostId",
        host_resource_group_arn="hostResourceGroupArn",
        partition_number=123,
        spread_domain="spreadDomain",
        tenancy="tenancy"
    ),
    private_dns_name_options=ec2.CfnLaunchTemplate.PrivateDnsNameOptionsProperty(
        enable_resource_name_dns_aaaa_record=False,
        enable_resource_name_dns_aRecord=False,
        hostname_type="hostnameType"
    ),
    ram_disk_id="ramDiskId",
    security_group_ids=["securityGroupIds"],
    security_groups=["securityGroups"],
    tag_specifications=[ec2.CfnLaunchTemplate.TagSpecificationProperty(
        resource_type="resourceType",
        tags=[CfnTag(
            key="key",
            value="value"
        )]
    )],
    user_data="userData"
)

Attributes

block_device_mappings

The block device mapping.

See:

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

capacity_reservation_specification

The Capacity Reservation targeting option.

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

See:

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

cpu_options

The CPU options for the instance.

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

See:

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

credit_specification

The credit option for CPU usage of the instance.

Valid only for T instances.

See:

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

disable_api_stop

Indicates whether to enable the instance for stop protection.

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

See:

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

disable_api_termination

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

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

See:

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

ebs_optimized

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

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

See:

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

elastic_gpu_specifications

Deprecated.

Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.

See:

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

elastic_inference_accelerators

An elastic inference accelerator to associate with the instance.

Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.

You cannot specify accelerators from different generations in the same request. .. epigraph:

Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.
See:

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

enclave_options

Indicates whether the instance is enabled for AWS Nitro Enclaves.

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

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

See:

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

hibernation_options

Indicates whether an instance is enabled for hibernation.

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

See:

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

iam_instance_profile

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

See:

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

image_id

The ID of the AMI.

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

Valid formats:

  • ami-17characters00000

  • resolve:ssm:parameter-name

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

  • resolve:ssm:parameter-name:label

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

See:

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

instance_initiated_shutdown_behavior

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

Default: stop

See:

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

instance_market_options

The market (purchasing) option for the instances.

See:

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

instance_requirements

The attributes for the instance types.

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

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

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

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

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

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

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

Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to use the launch template in the launch instance wizard , or with the RunInstances API or AWS::EC2::Instance AWS CloudFormation resource, you can’t specify InstanceRequirements .

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 .

See:

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

instance_type

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

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

See:

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

Type:

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

kernel_id

The ID of the kernel.

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

See:

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

key_name

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

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

See:

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

Type:

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

Type:

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

license_specifications

The license configurations.

See:

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

maintenance_options

The maintenance options of your instance.

See:

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

metadata_options

The metadata options for the instance.

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

See:

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

monitoring

The monitoring for the instance.

See:

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

network_interfaces

One or more network interfaces.

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

See:

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

placement

The placement for the instance.

See:

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

private_dns_name_options

The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled.

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

See:

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

ram_disk_id

The ID of the RAM disk.

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

See:

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

security_group_ids

The IDs of the security groups.

You can specify the IDs of existing security groups and references to resources created by the stack template.

See:

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

security_groups

One or more security group names.

For a nondefault VPC, you must use security group IDs instead.

See:

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

tag_specifications

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

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

To tag the launch template itself, use TagSpecifications .

See:

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

user_data

The user data to make available to the instance.

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

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

See:

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

LaunchTemplateElasticInferenceAcceleratorProperty

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

Bases: object

Specifies an elastic inference accelerator.

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

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

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

See:

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.
from aws_cdk import 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

See:

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

type

The type of elastic inference accelerator.

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

See:

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

LaunchTemplateTagSpecificationProperty

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

Bases: object

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

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

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

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

See:

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.
from aws_cdk import 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 .

See:

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

tags

The tags for the resource.

See:

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

LicenseSpecificationProperty

class CfnLaunchTemplate.LicenseSpecificationProperty(*, license_configuration_arn=None)

Bases: object

Specifies a license configuration for an instance.

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

Parameters:

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

See:

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.
from aws_cdk import 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.

See:

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

MaintenanceOptionsProperty

class CfnLaunchTemplate.MaintenanceOptionsProperty(*, auto_recovery=None, reboot_migration=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.

  • reboot_migration (Optional[str]) –

See:

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

maintenance_options_property = ec2.CfnLaunchTemplate.MaintenanceOptionsProperty(
    auto_recovery="autoRecovery",
    reboot_migration="rebootMigration"
)

Attributes

auto_recovery

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

See:

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

reboot_migration

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

Type:

see

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.

See:

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.
from aws_cdk import 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.

See:

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

min

The minimum amount of memory per vCPU, in GiB.

To specify no minimum limit, omit this parameter.

See:

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

MemoryMiBProperty

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

Bases: object

The minimum and maximum amount of memory, in MiB.

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

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

See:

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.
from aws_cdk import 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.

See:

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

min

The minimum amount of memory, in MiB.

To specify no minimum limit, specify 0 .

See:

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

MetadataOptionsProperty

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

Bases: object

The metadata options for the instance.

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

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

Parameters:
  • http_endpoint (Optional[str]) – Enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default state is enabled . .. epigraph:: If you specify a value of disabled , you will not be able to access your instance metadata.

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

  • http_put_response_hop_limit (Union[int, float, None]) – The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel. Default: 1 Possible values: Integers from 1 to 64

  • http_tokens (Optional[str]) – Indicates whether IMDSv2 is required. - optional - IMDSv2 is optional. You can choose whether to send a session token in your instance metadata retrieval requests. If you retrieve IAM role credentials without a session token, you receive the IMDSv1 role credentials. If you retrieve IAM role credentials using a valid session token, you receive the IMDSv2 role credentials. - required - IMDSv2 is required. You must send a session token in your instance metadata retrieval requests. With this option, retrieving the IAM role credentials always returns IMDSv2 credentials; IMDSv1 credentials are not available. Default: If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0 , the default is required .

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

See:

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

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import 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.
See:

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

http_protocol_ipv6

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

Default: disabled

See:

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

http_put_response_hop_limit

The desired HTTP PUT response hop limit for instance metadata requests.

The larger the number, the further instance metadata requests can travel.

Default: 1

Possible values: Integers from 1 to 64

See:

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

http_tokens

Indicates whether IMDSv2 is required.

  • optional - IMDSv2 is optional. You can choose whether to send a session token in your instance metadata retrieval requests. If you retrieve IAM role credentials without a session token, you receive the IMDSv1 role credentials. If you retrieve IAM role credentials using a valid session token, you receive the IMDSv2 role credentials.

  • required - IMDSv2 is required. You must send a session token in your instance metadata retrieval requests. With this option, retrieving the IAM role credentials always returns IMDSv2 credentials; IMDSv1 credentials are not available.

Default: If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0 , the default is required .

See:

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

instance_metadata_tags

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

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

Default: disabled

See:

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

MonitoringProperty

class CfnLaunchTemplate.MonitoringProperty(*, enabled=None)

Bases: object

Specifies whether detailed monitoring is enabled for an instance.

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

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

Parameters:

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

See:

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

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

Attributes

enabled

Specify true to enable detailed monitoring.

Otherwise, basic monitoring is enabled.

See:

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

NetworkBandwidthGbpsProperty

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

Bases: object

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

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

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

  • min (Union[int, float, None]) – The minimum amount of network bandwidth, in Gbps. If this parameter is not specified, there is no minimum limit.

See:

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

ExampleMetadata:

fixture=_generated

Example:

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

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

Attributes

max

The maximum amount of network bandwidth, in Gbps.

To specify no maximum limit, omit this parameter.

See:

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

min

The minimum amount of network bandwidth, in Gbps.

If this parameter is not specified, there is no minimum limit.

See:

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

NetworkInterfaceCountProperty

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

Bases: object

The minimum and maximum number of network interfaces.

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

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

See:

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.
from aws_cdk import 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.

See:

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

min

The minimum number of network interfaces.

To specify no minimum limit, omit this parameter.

See:

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

NetworkInterfaceProperty

class CfnLaunchTemplate.NetworkInterfaceProperty(*, associate_carrier_ip_address=None, associate_public_ip_address=None, connection_tracking_specification=None, delete_on_termination=None, description=None, device_index=None, ena_srd_specification=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, primary_ipv6=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]) – Associates 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. AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the Amazon VPC pricing page .

  • connection_tracking_specification (Union[IResolvable, ConnectionTrackingSpecificationProperty, Dict[str, Any], None]) – A connection tracking specification for the 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.

  • ena_srd_specification (Union[IResolvable, EnaSrdSpecificationProperty, Dict[str, Any], None]) – The ENA Express configuration for the network interface.

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

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

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

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

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

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

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

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

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

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

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

    The primary IPv6 address of the network interface. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. For more information about primary IPv6 addresses, see RunInstances .

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

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

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

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

See:

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.
from aws_cdk import aws_ec2 as ec2

network_interface_property = ec2.CfnLaunchTemplate.NetworkInterfaceProperty(
    associate_carrier_ip_address=False,
    associate_public_ip_address=False,
    connection_tracking_specification=ec2.CfnLaunchTemplate.ConnectionTrackingSpecificationProperty(
        tcp_established_timeout=123,
        udp_stream_timeout=123,
        udp_timeout=123
    ),
    delete_on_termination=False,
    description="description",
    device_index=123,
    ena_srd_specification=ec2.CfnLaunchTemplate.EnaSrdSpecificationProperty(
        ena_srd_enabled=False,
        ena_srd_udp_specification=ec2.CfnLaunchTemplate.EnaSrdUdpSpecificationProperty(
            ena_srd_udp_enabled=False
        )
    ),
    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",
    primary_ipv6=False,
    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

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

See:

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

associate_public_ip_address

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

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

See:

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

connection_tracking_specification

A connection tracking specification for the network interface.

See:

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

delete_on_termination

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

See:

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

description

A description for the network interface.

See:

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

device_index

The device index for the network interface attachment.

See:

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

ena_srd_specification

The ENA Express configuration for the network interface.

See:

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

groups

The IDs of one or more security groups.

See:

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

interface_type

The type of network interface.

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

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

Valid values: interface | efa

See:

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

ipv4_prefix_count

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

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

See:

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

ipv4_prefixes

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

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

See:

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

ipv6_address_count

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

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

See:

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

ipv6_addresses

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

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

See:

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

ipv6_prefix_count

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

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

See:

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

ipv6_prefixes

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

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

See:

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

network_card_index

The index of the network card.

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

See:

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

network_interface_id

The ID of the network interface.

See:

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

primary_ipv6

The primary IPv6 address of the network interface.

When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. For more information about primary IPv6 addresses, see RunInstances .

See:

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

private_ip_address

The primary private IPv4 address of the network interface.

See:

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

private_ip_addresses

One or more private IPv4 addresses.

See:

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

secondary_private_ip_address_count

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

See:

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

subnet_id

The ID of the subnet for the network interface.

See:

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

PlacementProperty

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

Bases: object

Specifies the placement of an instance.

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

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

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

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

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

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

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

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

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

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

See:

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

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

Attributes

affinity

The affinity setting for an instance on a Dedicated Host.

See:

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

availability_zone

The Availability Zone for the instance.

See:

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

group_id

The Group Id of a placement group.

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

See:

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

group_name

The name of the placement group for the instance.

See:

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

host_id

The ID of the Dedicated Host for the instance.

See:

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

host_resource_group_arn

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

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

See:

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

partition_number

The number of the partition the instance should launch in.

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

See:

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

spread_domain

Reserved for future use.

See:

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

tenancy

The tenancy of the instance.

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

See:

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

PrivateDnsNameOptionsProperty

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

Bases: object

The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled.

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

Parameters:
  • enable_resource_name_dns_aaaa_record (Union[bool, IResolvable, None]) – Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.

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

See:

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

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import 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.

See:

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

enable_resource_name_dns_aaaa_record

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

See:

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

hostname_type

The type of hostname for EC2 instances.

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

See:

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

PrivateIpAddProperty

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

Bases: object

Specifies a secondary private IPv4 address for a network interface.

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

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

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

See:

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.
from aws_cdk import 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.

See:

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

private_ip_address

The private IPv4 address.

See:

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

SpotOptionsProperty

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

Bases: object

Specifies options for Spot Instances.

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

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

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

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

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

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

See:

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

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

Attributes

block_duration_minutes

Deprecated.

See:

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

instance_interruption_behavior

The behavior when a Spot Instance is interrupted.

The default is terminate .

See:

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

max_price

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

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

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

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

spot_instance_type

The Spot Instance request type.

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

See:

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

valid_until

SS* Z). Supported only for persistent requests.

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

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

Default: 7 days from the current date

See:

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

Type:

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

Type:

MM

TagSpecificationProperty

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

Bases: object

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

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

Parameters:
  • resource_type (Optional[str]) –

    The type of resource to tag. Valid Values lists all resource types for Amazon EC2 that can be tagged. When you create a launch template, you can specify tags for the following resource types only: instance | volume | network-interface | spot-instances-request . If the instance does not include the resource type that you specify, the instance launch fails. For example, not all instance types include a volume. To tag a resource after it has been created, see CreateTags .

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

See:

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.
from aws_cdk import 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.

Valid Values lists all resource types for Amazon EC2 that can be tagged. When you create a launch template, you can specify tags for the following resource types only: instance | volume | network-interface | spot-instances-request . If the instance does not include the resource type that you specify, the instance launch fails. For example, not all instance types include a volume.

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

See:

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

tags

The tags to apply to the resource.

See:

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

TotalLocalStorageGBProperty

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

Bases: object

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

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

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

See:

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.
from aws_cdk import 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.

See:

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

min

The minimum amount of total local storage, in GB.

To specify no minimum limit, omit this parameter.

See:

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

VCpuCountProperty

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

Bases: object

The minimum and maximum number of vCPUs.

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

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

See:

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.
from aws_cdk import 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.

See:

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

min

The minimum number of vCPUs.

To specify no minimum limit, specify 0 .

See:

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