Class CfnLaunchTemplatePropsMixin
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.ec2.CfnLaunchTemplatePropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)",
date="2026-03-11T13:19:58.489Z")
@Stability(Stable)
public class CfnLaunchTemplatePropsMixin
extends Mixin
implements software.constructs.IMixin
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 .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cfnpropertymixins.services.ec2.*;
import software.amazon.awscdk.*;
IMergeStrategy mergeStrategy;
CfnLaunchTemplatePropsMixin cfnLaunchTemplatePropsMixin = CfnLaunchTemplatePropsMixin.Builder.create(CfnLaunchTemplateMixinProps.builder()
.launchTemplateData(LaunchTemplateDataProperty.builder()
.blockDeviceMappings(List.of(BlockDeviceMappingProperty.builder()
.deviceName("deviceName")
.ebs(EbsProperty.builder()
.deleteOnTermination(false)
.ebsCardIndex(123)
.encrypted(false)
.iops(123)
.kmsKeyId("kmsKeyId")
.snapshotId("snapshotId")
.throughput(123)
.volumeInitializationRate(123)
.volumeSize(123)
.volumeType("volumeType")
.build())
.noDevice("noDevice")
.virtualName("virtualName")
.build()))
.capacityReservationSpecification(CapacityReservationSpecificationProperty.builder()
.capacityReservationPreference("capacityReservationPreference")
.capacityReservationTarget(CapacityReservationTargetProperty.builder()
.capacityReservationId("capacityReservationId")
.capacityReservationResourceGroupArn("capacityReservationResourceGroupArn")
.build())
.build())
.cpuOptions(CpuOptionsProperty.builder()
.amdSevSnp("amdSevSnp")
.coreCount(123)
.threadsPerCore(123)
.build())
.creditSpecification(CreditSpecificationProperty.builder()
.cpuCredits("cpuCredits")
.build())
.disableApiStop(false)
.disableApiTermination(false)
.ebsOptimized(false)
.elasticGpuSpecifications(List.of(ElasticGpuSpecificationProperty.builder()
.type("type")
.build()))
.elasticInferenceAccelerators(List.of(LaunchTemplateElasticInferenceAcceleratorProperty.builder()
.count(123)
.type("type")
.build()))
.enclaveOptions(EnclaveOptionsProperty.builder()
.enabled(false)
.build())
.hibernationOptions(HibernationOptionsProperty.builder()
.configured(false)
.build())
.iamInstanceProfile(IamInstanceProfileProperty.builder()
.arn("arn")
.name("name")
.build())
.imageId("imageId")
.instanceInitiatedShutdownBehavior("instanceInitiatedShutdownBehavior")
.instanceMarketOptions(InstanceMarketOptionsProperty.builder()
.marketType("marketType")
.spotOptions(SpotOptionsProperty.builder()
.blockDurationMinutes(123)
.instanceInterruptionBehavior("instanceInterruptionBehavior")
.maxPrice("maxPrice")
.spotInstanceType("spotInstanceType")
.validUntil("validUntil")
.build())
.build())
.instanceRequirements(InstanceRequirementsProperty.builder()
.acceleratorCount(AcceleratorCountProperty.builder()
.max(123)
.min(123)
.build())
.acceleratorManufacturers(List.of("acceleratorManufacturers"))
.acceleratorNames(List.of("acceleratorNames"))
.acceleratorTotalMemoryMiB(AcceleratorTotalMemoryMiBProperty.builder()
.max(123)
.min(123)
.build())
.acceleratorTypes(List.of("acceleratorTypes"))
.allowedInstanceTypes(List.of("allowedInstanceTypes"))
.bareMetal("bareMetal")
.baselineEbsBandwidthMbps(BaselineEbsBandwidthMbpsProperty.builder()
.max(123)
.min(123)
.build())
.baselinePerformanceFactors(BaselinePerformanceFactorsProperty.builder()
.cpu(CpuProperty.builder()
.references(List.of(ReferenceProperty.builder()
.instanceFamily("instanceFamily")
.build()))
.build())
.build())
.burstablePerformance("burstablePerformance")
.cpuManufacturers(List.of("cpuManufacturers"))
.excludedInstanceTypes(List.of("excludedInstanceTypes"))
.instanceGenerations(List.of("instanceGenerations"))
.localStorage("localStorage")
.localStorageTypes(List.of("localStorageTypes"))
.maxSpotPriceAsPercentageOfOptimalOnDemandPrice(123)
.memoryGiBPerVCpu(MemoryGiBPerVCpuProperty.builder()
.max(123)
.min(123)
.build())
.memoryMiB(MemoryMiBProperty.builder()
.max(123)
.min(123)
.build())
.networkBandwidthGbps(NetworkBandwidthGbpsProperty.builder()
.max(123)
.min(123)
.build())
.networkInterfaceCount(NetworkInterfaceCountProperty.builder()
.max(123)
.min(123)
.build())
.onDemandMaxPricePercentageOverLowestPrice(123)
.requireHibernateSupport(false)
.spotMaxPricePercentageOverLowestPrice(123)
.totalLocalStorageGb(TotalLocalStorageGBProperty.builder()
.max(123)
.min(123)
.build())
.vCpuCount(VCpuCountProperty.builder()
.max(123)
.min(123)
.build())
.build())
.instanceType("instanceType")
.kernelId("kernelId")
.keyName("keyName")
.licenseSpecifications(List.of(LicenseSpecificationProperty.builder()
.licenseConfigurationArn("licenseConfigurationArn")
.build()))
.maintenanceOptions(MaintenanceOptionsProperty.builder()
.autoRecovery("autoRecovery")
.build())
.metadataOptions(MetadataOptionsProperty.builder()
.httpEndpoint("httpEndpoint")
.httpProtocolIpv6("httpProtocolIpv6")
.httpPutResponseHopLimit(123)
.httpTokens("httpTokens")
.instanceMetadataTags("instanceMetadataTags")
.build())
.monitoring(MonitoringProperty.builder()
.enabled(false)
.build())
.networkInterfaces(List.of(NetworkInterfaceProperty.builder()
.associateCarrierIpAddress(false)
.associatePublicIpAddress(false)
.connectionTrackingSpecification(ConnectionTrackingSpecificationProperty.builder()
.tcpEstablishedTimeout(123)
.udpStreamTimeout(123)
.udpTimeout(123)
.build())
.deleteOnTermination(false)
.description("description")
.deviceIndex(123)
.enaQueueCount(123)
.enaSrdSpecification(EnaSrdSpecificationProperty.builder()
.enaSrdEnabled(false)
.enaSrdUdpSpecification(EnaSrdUdpSpecificationProperty.builder()
.enaSrdUdpEnabled(false)
.build())
.build())
.groups(List.of("groups"))
.interfaceType("interfaceType")
.ipv4PrefixCount(123)
.ipv4Prefixes(List.of(Ipv4PrefixSpecificationProperty.builder()
.ipv4Prefix("ipv4Prefix")
.build()))
.ipv6AddressCount(123)
.ipv6Addresses(List.of(Ipv6AddProperty.builder()
.ipv6Address("ipv6Address")
.build()))
.ipv6PrefixCount(123)
.ipv6Prefixes(List.of(Ipv6PrefixSpecificationProperty.builder()
.ipv6Prefix("ipv6Prefix")
.build()))
.networkCardIndex(123)
.networkInterfaceId("networkInterfaceId")
.primaryIpv6(false)
.privateIpAddress("privateIpAddress")
.privateIpAddresses(List.of(PrivateIpAddProperty.builder()
.primary(false)
.privateIpAddress("privateIpAddress")
.build()))
.secondaryPrivateIpAddressCount(123)
.subnetId("subnetId")
.build()))
.networkPerformanceOptions(NetworkPerformanceOptionsProperty.builder()
.bandwidthWeighting("bandwidthWeighting")
.build())
.placement(PlacementProperty.builder()
.affinity("affinity")
.availabilityZone("availabilityZone")
.groupId("groupId")
.groupName("groupName")
.hostId("hostId")
.hostResourceGroupArn("hostResourceGroupArn")
.partitionNumber(123)
.spreadDomain("spreadDomain")
.tenancy("tenancy")
.build())
.privateDnsNameOptions(PrivateDnsNameOptionsProperty.builder()
.enableResourceNameDnsAaaaRecord(false)
.enableResourceNameDnsARecord(false)
.hostnameType("hostnameType")
.build())
.ramDiskId("ramDiskId")
.securityGroupIds(List.of("securityGroupIds"))
.securityGroups(List.of("securityGroups"))
.tagSpecifications(List.of(TagSpecificationProperty.builder()
.resourceType("resourceType")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build()))
.userData("userData")
.build())
.launchTemplateName("launchTemplateName")
.tagSpecifications(List.of(LaunchTemplateTagSpecificationProperty.builder()
.resourceType("resourceType")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build()))
.versionDescription("versionDescription")
.build())
.strategy(mergeStrategy)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance.static interfaceThe minimum and maximum amount of total accelerator memory, in MiB.static interfaceThe minimum and maximum baseline bandwidth to Amazon EBS, in Mbps.static interfaceThe baseline performance to consider, using an instance family as a baseline reference.static interfaceSpecifies a block device mapping for a launch template.static final classA fluent builder forCfnLaunchTemplatePropsMixin.static interfaceSpecifies an instance's Capacity Reservation targeting option.static interfaceSpecifies a target Capacity Reservation.static interfaceA security group connection tracking specification that enables you to set the idle timeout for connection tracking on an Elastic network interface.static interfaceSpecifies the CPU options for an instance.static interfaceSpecifies the CPU performance to consider when using an instance family as the baseline reference.static interfaceSpecifies the credit option for CPU usage of a T2, T3, or T3a instance.static interfaceParameters for a block device for an EBS volume in an Amazon EC2 launch template.static interfaceExample:static interfaceENA 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 interfaceENA Express is compatible with both TCP and UDP transport protocols.static interfaceIndicates whether the instance is enabled for AWS Nitro Enclaves.static interfaceSpecifies whether your instance is configured for hibernation.static interfaceSpecifies an IAM instance profile, which is a container for an IAM role for your instance.static interfaceSpecifies the market (purchasing) option for an instance.static interfaceThe attributes for the instance types.static interfaceSpecifies an IPv4 prefix for a network interface.static interfaceSpecifies an IPv6 address in an Amazon EC2 launch template.static interfaceSpecifies an IPv6 prefix for a network interface.static interfaceThe information to include in the launch template.static interfaceExample:static interfaceSpecifies the tags to apply to the launch template during creation.static interfaceSpecifies a license configuration for an instance.static interfaceThe maintenance options of your instance.static interfaceThe minimum and maximum amount of memory per vCPU, in GiB.static interfaceThe minimum and maximum amount of memory, in MiB.static interfaceThe metadata options for the instance.static interfaceSpecifies whether detailed monitoring is enabled for an instance.static interfaceThe minimum and maximum amount of network bandwidth, in gigabits per second (Gbps).static interfaceThe minimum and maximum number of network interfaces.static interfaceSpecifies the parameters for a network interface.static interfaceContains settings for the network performance options for the instance.static interfaceSpecifies the placement of an instance.static interfaceThe hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled.static interfaceSpecifies a secondary private IPv4 address for a network interface.static interfaceSpecifies an instance family to use as the baseline reference for CPU performance.static interfaceSpecifies options for Spot Instances.static interfaceSpecifies the tags to apply to resources that are created during instance launch.static interfaceThe minimum and maximum amount of total local storage, in GB.static interfaceThe minimum and maximum number of vCPUs.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::EC2::LaunchTemplate.Create a mixin to apply properties toAWS::EC2::LaunchTemplate.protectedCfnLaunchTemplatePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnLaunchTemplatePropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnLaunchTemplateMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_PROPERTY_KEYS
-
-
Constructor Details
-
CfnLaunchTemplatePropsMixin
protected CfnLaunchTemplatePropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
CfnLaunchTemplatePropsMixin
protected CfnLaunchTemplatePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnLaunchTemplatePropsMixin
@Stability(Stable) public CfnLaunchTemplatePropsMixin(@NotNull CfnLaunchTemplateMixinProps props, @Nullable CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::EC2::LaunchTemplate.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnLaunchTemplatePropsMixin
Create a mixin to apply properties toAWS::EC2::LaunchTemplate.- Parameters:
props- L1 properties to apply. This parameter is required.
-
-
Method Details
-
applyTo
@Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct) Apply the mixin properties to the construct. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-