@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.222Z") @Stability(value=Stable) public class CfnLaunchTemplate extends CfnResource implements IInspectable
Specifies a launch template for an Amazon EC2 instance. A launch template contains the parameters to launch an instance. For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .
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());
| Modifier and Type | Class and Description |
|---|---|
static interface |
CfnLaunchTemplate.AcceleratorCountProperty
The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance.
|
static interface |
CfnLaunchTemplate.AcceleratorTotalMemoryMiBProperty
The minimum and maximum amount of total accelerator memory, in MiB.
|
static interface |
CfnLaunchTemplate.BaselineEbsBandwidthMbpsProperty
The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps.
|
static interface |
CfnLaunchTemplate.BlockDeviceMappingProperty
Information about a block device mapping for an Amazon EC2 launch template.
|
static class |
CfnLaunchTemplate.Builder
A fluent builder for
CfnLaunchTemplate. |
static interface |
CfnLaunchTemplate.CapacityReservationSpecificationProperty
Specifies an instance's Capacity Reservation targeting option.
|
static interface |
CfnLaunchTemplate.CapacityReservationTargetProperty
Specifies a target Capacity Reservation.
|
static interface |
CfnLaunchTemplate.CpuOptionsProperty
Specifies the CPU options for an instance.
|
static interface |
CfnLaunchTemplate.CreditSpecificationProperty
Specifies the credit option for CPU usage of a T2, T3, or T3a instance.
|
static interface |
CfnLaunchTemplate.EbsProperty
Parameters for a block device for an EBS volume in an Amazon EC2 launch template.
|
static interface |
CfnLaunchTemplate.ElasticGpuSpecificationProperty
Specifies a specification for an Elastic GPU for an Amazon EC2 launch template.
|
static interface |
CfnLaunchTemplate.EnclaveOptionsProperty
Indicates whether the instance is enabled for AWS Nitro Enclaves.
|
static interface |
CfnLaunchTemplate.HibernationOptionsProperty
Specifies whether your instance is configured for hibernation.
|
static interface |
CfnLaunchTemplate.IamInstanceProfileProperty
Specifies an IAM instance profile, which is a container for an IAM role for your instance.
|
static interface |
CfnLaunchTemplate.InstanceMarketOptionsProperty
Specifies the market (purchasing) option for an instance.
|
static interface |
CfnLaunchTemplate.InstanceRequirementsProperty
The attributes for the instance types.
|
static interface |
CfnLaunchTemplate.Ipv4PrefixSpecificationProperty
Specifies an IPv4 prefix for a network interface.
|
static interface |
CfnLaunchTemplate.Ipv6AddProperty
Specifies an IPv6 address in an Amazon EC2 launch template.
|
static interface |
CfnLaunchTemplate.Ipv6PrefixSpecificationProperty
Specifies an IPv6 prefix for a network interface.
|
static interface |
CfnLaunchTemplate.LaunchTemplateDataProperty
The information to include in the launch template.
|
static interface |
CfnLaunchTemplate.LaunchTemplateElasticInferenceAcceleratorProperty
Specifies an elastic inference accelerator.
|
static interface |
CfnLaunchTemplate.LaunchTemplateTagSpecificationProperty
Specifies the tags to apply to the launch template during creation.
|
static interface |
CfnLaunchTemplate.LicenseSpecificationProperty
Specifies a license configuration for an instance.
|
static interface |
CfnLaunchTemplate.MaintenanceOptionsProperty
The maintenance options of your instance.
|
static interface |
CfnLaunchTemplate.MemoryGiBPerVCpuProperty
The minimum and maximum amount of memory per vCPU, in GiB.
|
static interface |
CfnLaunchTemplate.MemoryMiBProperty
The minimum and maximum amount of memory, in MiB.
|
static interface |
CfnLaunchTemplate.MetadataOptionsProperty
Specifies the metadata options for the instance.
|
static interface |
CfnLaunchTemplate.MonitoringProperty
Specifies whether detailed monitoring is enabled for an instance.
|
static interface |
CfnLaunchTemplate.NetworkInterfaceCountProperty
The minimum and maximum number of network interfaces.
|
static interface |
CfnLaunchTemplate.NetworkInterfaceProperty
Specifies the parameters for a network interface.
|
static interface |
CfnLaunchTemplate.PlacementProperty
Specifies the placement of an instance.
|
static interface |
CfnLaunchTemplate.PrivateDnsNameOptionsProperty
Describes the options for instance hostnames.
|
static interface |
CfnLaunchTemplate.PrivateIpAddProperty
Specifies a secondary private IPv4 address for a network interface.
|
static interface |
CfnLaunchTemplate.SpotOptionsProperty
Specifies options for Spot Instances.
|
static interface |
CfnLaunchTemplate.TagSpecificationProperty
Specifies the tags to apply to a resource when the resource is created for the launch template.
|
static interface |
CfnLaunchTemplate.TotalLocalStorageGBProperty
The minimum and maximum amount of total local storage, in GB.
|
static interface |
CfnLaunchTemplate.VCpuCountProperty
The minimum and maximum number of vCPUs.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnLaunchTemplate(software.constructs.Construct scope,
String id,
CfnLaunchTemplateProps props)
Create a new `AWS::EC2::LaunchTemplate`.
|
protected |
CfnLaunchTemplate(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnLaunchTemplate(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrDefaultVersionNumber()
The default version of the launch template, such as 2.
|
String |
getAttrLatestVersionNumber()
The latest version of the launch template, such as `5` .
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getLaunchTemplateData()
The information for the launch template.
|
String |
getLaunchTemplateName()
A name for the launch template.
|
Object |
getTagSpecifications()
The tags to apply to the launch template during creation.
|
String |
getVersionDescription()
`AWS::EC2::LaunchTemplate.VersionDescription`.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setLaunchTemplateData(CfnLaunchTemplate.LaunchTemplateDataProperty value)
The information for the launch template.
|
void |
setLaunchTemplateData(IResolvable value)
The information for the launch template.
|
void |
setLaunchTemplateName(String value)
A name for the launch template.
|
void |
setTagSpecifications(IResolvable value)
The tags to apply to the launch template during creation.
|
void |
setTagSpecifications(List<Object> value)
The tags to apply to the launch template during creation.
|
void |
setVersionDescription(String value)
`AWS::EC2::LaunchTemplate.VersionDescription`.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnLaunchTemplate(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnLaunchTemplate(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnLaunchTemplate(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnLaunchTemplateProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrDefaultVersionNumber()
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.
@Stability(value=Stable) @NotNull public String getAttrLatestVersionNumber()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public Object getLaunchTemplateData()
@Stability(value=Stable)
public void setLaunchTemplateData(@NotNull
CfnLaunchTemplate.LaunchTemplateDataProperty value)
@Stability(value=Stable)
public void setLaunchTemplateData(@NotNull
IResolvable value)
@Stability(value=Stable) @Nullable public String getLaunchTemplateName()
@Stability(value=Stable)
public void setLaunchTemplateName(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getTagSpecifications()
@Stability(value=Stable)
public void setTagSpecifications(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setTagSpecifications(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public String getVersionDescription()
@Stability(value=Stable)
public void setVersionDescription(@Nullable
String value)
Copyright © 2022. All rights reserved.