Class CfnLaunchTemplate
- All Implemented Interfaces:
IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
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 can optionally specify a name for the launch template. If you do not specify a name, AWS CloudFormation creates a 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 .
Example:
Cluster cluster; String userData = "MIME-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"==MYBOUNDARY==\"\n\n--==MYBOUNDARY==\nContent-Type: text/x-shellscript; charset=\"us-ascii\"\n\n#!/bin/bash\necho \"Running custom user data script\"\n\n--==MYBOUNDARY==--\\\n"; CfnLaunchTemplate lt = CfnLaunchTemplate.Builder.create(this, "LaunchTemplate") .launchTemplateData(LaunchTemplateDataProperty.builder() .instanceType("t3.small") .userData(Fn.base64(userData)) .build()) .build(); cluster.addNodegroupCapacity("extra-ng", NodegroupOptions.builder() .launchTemplateSpec(LaunchTemplateSpec.builder() .id(lt.getRef()) .version(lt.getAttrLatestVersionNumber()) .build()) .build());
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance.static interface
The minimum and maximum amount of total accelerator memory, in MiB.static interface
The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps.static interface
Example:static interface
Specifies a block device mapping for a launch template.static final class
A fluent builder forCfnLaunchTemplate
.static interface
Specifies an instance's Capacity Reservation targeting option.static interface
Specifies a target Capacity Reservation.static interface
A security group connection tracking specification that enables you to set the idle timeout for connection tracking on an Elastic network interface.static interface
Specifies the CPU options for an instance.static interface
Example:static interface
Specifies the credit option for CPU usage of a T2, T3, or T3a instance.static interface
Parameters for a block device for an EBS volume in an Amazon EC2 launch template.static interface
static interface
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.static interface
ENA Express is compatible with both TCP and UDP transport protocols.static interface
Indicates whether the instance is enabled for AWS Nitro Enclaves.static interface
Specifies whether your instance is configured for hibernation.static interface
Specifies an IAM instance profile, which is a container for an IAM role for your instance.static interface
Specifies the market (purchasing) option for an instance.static interface
The attributes for the instance types.static interface
Specifies an IPv4 prefix for a network interface.static interface
Specifies an IPv6 address in an Amazon EC2 launch template.static interface
Specifies an IPv6 prefix for a network interface.static interface
The information to include in the launch template.static interface
Specifies an elastic inference accelerator.static interface
Specifies the tags to apply to the launch template during creation.static interface
Specifies a license configuration for an instance.static interface
The maintenance options of your instance.static interface
The minimum and maximum amount of memory per vCPU, in GiB.static interface
The minimum and maximum amount of memory, in MiB.static interface
The metadata options for the instance.static interface
Specifies whether detailed monitoring is enabled for an instance.static interface
The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps).static interface
The minimum and maximum number of network interfaces.static interface
Specifies the parameters for a network interface.static interface
Specifies the placement of an instance.static interface
The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled.static interface
Specifies a secondary private IPv4 address for a network interface.static interface
Example:static interface
Specifies options for Spot Instances.static interface
Specifies the tags to apply to resources that are created during instance launch.static interface
The minimum and maximum amount of total local storage, in GB.static interface
The minimum and maximum number of vCPUs.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnLaunchTemplate
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnLaunchTemplate
(software.amazon.jsii.JsiiObjectRef objRef) CfnLaunchTemplate
(software.constructs.Construct scope, String id, CfnLaunchTemplateProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe default version of the launch template, such as 2.The latest version of the launch template, such as5
.The ID of the launch template.The information for the launch template.A name for the launch template.The tags to apply to the launch template on creation.A description for the first version of the launch template.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setLaunchTemplateData
(IResolvable value) The information for the launch template.void
The information for the launch template.void
setLaunchTemplateName
(String value) A name for the launch template.void
setTagSpecifications
(List<Object> value) The tags to apply to the launch template on creation.void
setTagSpecifications
(IResolvable value) The tags to apply to the launch template on creation.void
setVersionDescription
(String value) A description for the first version of the launch template.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnLaunchTemplate
protected CfnLaunchTemplate(software.amazon.jsii.JsiiObjectRef objRef) -
CfnLaunchTemplate
protected CfnLaunchTemplate(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnLaunchTemplate
@Stability(Stable) public CfnLaunchTemplate(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnLaunchTemplateProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrDefaultVersionNumber
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. -
getAttrLatestVersionNumber
The latest version of the launch template, such as5
. -
getAttrLaunchTemplateId
The ID of the launch template. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getLaunchTemplateData
The information for the launch template. -
setLaunchTemplateData
The information for the launch template. -
setLaunchTemplateData
@Stability(Stable) public void setLaunchTemplateData(@NotNull CfnLaunchTemplate.LaunchTemplateDataProperty value) The information for the launch template. -
getLaunchTemplateName
A name for the launch template. -
setLaunchTemplateName
A name for the launch template. -
getTagSpecifications
The tags to apply to the launch template on creation. -
setTagSpecifications
The tags to apply to the launch template on creation. -
setTagSpecifications
The tags to apply to the launch template on creation. -
getVersionDescription
A description for the first version of the launch template. -
setVersionDescription
A description for the first version of the launch template.
-