class CfnLaunchTemplatePropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.EC2.Mixins.CfnLaunchTemplatePropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awsec2/mixins#CfnLaunchTemplatePropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.ec2.mixins.CfnLaunchTemplatePropsMixin |
Python | aws_cdk.mixins_preview.aws_ec2.mixins.CfnLaunchTemplatePropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_ec2 » mixins » CfnLaunchTemplatePropsMixin |
Implements
IMixin
Extends
Mixin
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 can optionally specify a name for the launch template. If you do not specify a name, 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 .
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { mixins } from '@aws-cdk/mixins-preview';
import { mixins as ec2_mixins } from '@aws-cdk/mixins-preview/aws-ec2';
const cfnLaunchTemplatePropsMixin = new ec2_mixins.CfnLaunchTemplatePropsMixin({
launchTemplateData: {
blockDeviceMappings: [{
deviceName: 'deviceName',
ebs: {
deleteOnTermination: false,
encrypted: false,
iops: 123,
kmsKeyId: 'kmsKeyId',
snapshotId: 'snapshotId',
throughput: 123,
volumeInitializationRate: 123,
volumeSize: 123,
volumeType: 'volumeType',
},
noDevice: 'noDevice',
virtualName: 'virtualName',
}],
capacityReservationSpecification: {
capacityReservationPreference: 'capacityReservationPreference',
capacityReservationTarget: {
capacityReservationId: 'capacityReservationId',
capacityReservationResourceGroupArn: 'capacityReservationResourceGroupArn',
},
},
cpuOptions: {
amdSevSnp: 'amdSevSnp',
coreCount: 123,
threadsPerCore: 123,
},
creditSpecification: {
cpuCredits: 'cpuCredits',
},
disableApiStop: false,
disableApiTermination: false,
ebsOptimized: false,
elasticGpuSpecifications: [{
type: 'type',
}],
elasticInferenceAccelerators: [{
count: 123,
type: 'type',
}],
enclaveOptions: {
enabled: false,
},
hibernationOptions: {
configured: false,
},
iamInstanceProfile: {
arn: 'arn',
name: 'name',
},
imageId: 'imageId',
instanceInitiatedShutdownBehavior: 'instanceInitiatedShutdownBehavior',
instanceMarketOptions: {
marketType: 'marketType',
spotOptions: {
blockDurationMinutes: 123,
instanceInterruptionBehavior: 'instanceInterruptionBehavior',
maxPrice: 'maxPrice',
spotInstanceType: 'spotInstanceType',
validUntil: 'validUntil',
},
},
instanceRequirements: {
acceleratorCount: {
max: 123,
min: 123,
},
acceleratorManufacturers: ['acceleratorManufacturers'],
acceleratorNames: ['acceleratorNames'],
acceleratorTotalMemoryMiB: {
max: 123,
min: 123,
},
acceleratorTypes: ['acceleratorTypes'],
allowedInstanceTypes: ['allowedInstanceTypes'],
bareMetal: 'bareMetal',
baselineEbsBandwidthMbps: {
max: 123,
min: 123,
},
baselinePerformanceFactors: {
cpu: {
references: [{
instanceFamily: 'instanceFamily',
}],
},
},
burstablePerformance: 'burstablePerformance',
cpuManufacturers: ['cpuManufacturers'],
excludedInstanceTypes: ['excludedInstanceTypes'],
instanceGenerations: ['instanceGenerations'],
localStorage: 'localStorage',
localStorageTypes: ['localStorageTypes'],
maxSpotPriceAsPercentageOfOptimalOnDemandPrice: 123,
memoryGiBPerVCpu: {
max: 123,
min: 123,
},
memoryMiB: {
max: 123,
min: 123,
},
networkBandwidthGbps: {
max: 123,
min: 123,
},
networkInterfaceCount: {
max: 123,
min: 123,
},
onDemandMaxPricePercentageOverLowestPrice: 123,
requireHibernateSupport: false,
spotMaxPricePercentageOverLowestPrice: 123,
totalLocalStorageGb: {
max: 123,
min: 123,
},
vCpuCount: {
max: 123,
min: 123,
},
},
instanceType: 'instanceType',
kernelId: 'kernelId',
keyName: 'keyName',
licenseSpecifications: [{
licenseConfigurationArn: 'licenseConfigurationArn',
}],
maintenanceOptions: {
autoRecovery: 'autoRecovery',
},
metadataOptions: {
httpEndpoint: 'httpEndpoint',
httpProtocolIpv6: 'httpProtocolIpv6',
httpPutResponseHopLimit: 123,
httpTokens: 'httpTokens',
instanceMetadataTags: 'instanceMetadataTags',
},
monitoring: {
enabled: false,
},
networkInterfaces: [{
associateCarrierIpAddress: false,
associatePublicIpAddress: false,
connectionTrackingSpecification: {
tcpEstablishedTimeout: 123,
udpStreamTimeout: 123,
udpTimeout: 123,
},
deleteOnTermination: false,
description: 'description',
deviceIndex: 123,
enaQueueCount: 123,
enaSrdSpecification: {
enaSrdEnabled: false,
enaSrdUdpSpecification: {
enaSrdUdpEnabled: false,
},
},
groups: ['groups'],
interfaceType: 'interfaceType',
ipv4PrefixCount: 123,
ipv4Prefixes: [{
ipv4Prefix: 'ipv4Prefix',
}],
ipv6AddressCount: 123,
ipv6Addresses: [{
ipv6Address: 'ipv6Address',
}],
ipv6PrefixCount: 123,
ipv6Prefixes: [{
ipv6Prefix: 'ipv6Prefix',
}],
networkCardIndex: 123,
networkInterfaceId: 'networkInterfaceId',
primaryIpv6: false,
privateIpAddress: 'privateIpAddress',
privateIpAddresses: [{
primary: false,
privateIpAddress: 'privateIpAddress',
}],
secondaryPrivateIpAddressCount: 123,
subnetId: 'subnetId',
}],
networkPerformanceOptions: {
bandwidthWeighting: 'bandwidthWeighting',
},
placement: {
affinity: 'affinity',
availabilityZone: 'availabilityZone',
groupId: 'groupId',
groupName: 'groupName',
hostId: 'hostId',
hostResourceGroupArn: 'hostResourceGroupArn',
partitionNumber: 123,
spreadDomain: 'spreadDomain',
tenancy: 'tenancy',
},
privateDnsNameOptions: {
enableResourceNameDnsAaaaRecord: false,
enableResourceNameDnsARecord: false,
hostnameType: 'hostnameType',
},
ramDiskId: 'ramDiskId',
securityGroupIds: ['securityGroupIds'],
securityGroups: ['securityGroups'],
tagSpecifications: [{
resourceType: 'resourceType',
tags: [{
key: 'key',
value: 'value',
}],
}],
userData: 'userData',
},
launchTemplateName: 'launchTemplateName',
tagSpecifications: [{
resourceType: 'resourceType',
tags: [{
key: 'key',
value: 'value',
}],
}],
versionDescription: 'versionDescription',
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnLaunchTemplatePropsMixin(props: CfnLaunchTemplateMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.Launch Template Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::EC2::LaunchTemplate.
Properties
| Name | Type | Description |
|---|---|---|
| props | Cfn | |
| strategy | Property | |
| static CFN_PROPERTY_KEYS | string[] |
props
Type:
Cfn
strategy
Type:
Property
static CFN_PROPERTY_KEYS
Type:
string[]
Methods
| Name | Description |
|---|---|
| apply | Apply the mixin properties to the construct. |
| supports(construct) | Check if this mixin supports the given construct. |
applyTo(construct)
public applyTo(construct: IConstruct): IConstruct
Parameters
- construct
IConstruct
Returns
Apply the mixin properties to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct.

.NET
Go
Java
Python
TypeScript