Interface CfnLaunchTemplate.LaunchTemplateDataProperty
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnLaunchTemplate.LaunchTemplateDataProperty.Jsii$Proxy
- Enclosing class:
CfnLaunchTemplate
You must specify at least one parameter for the launch template data.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;
LaunchTemplateDataProperty launchTemplateDataProperty = LaunchTemplateDataProperty.builder()
.blockDeviceMappings(List.of(BlockDeviceMappingProperty.builder()
.deviceName("deviceName")
.ebs(EbsProperty.builder()
.deleteOnTermination(false)
.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();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnLaunchTemplate.LaunchTemplateDataPropertystatic final classAn implementation forCfnLaunchTemplate.LaunchTemplateDataProperty -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default ObjectThe block device mapping.default ObjectThe Capacity Reservation targeting option.default ObjectThe CPU options for the instance.default ObjectThe credit option for CPU usage of the instance.default ObjectIndicates whether to enable the instance for stop protection.default ObjectIndicates whether termination protection is enabled for the instance.default ObjectIndicates whether the instance is optimized for Amazon EBS I/O.default ObjectReturns union: eitherIResolvableor Listinvalid input: '<'eitherIResolvableorCfnLaunchTemplate.ElasticGpuSpecificationProperty>default ObjectReturns union: eitherIResolvableor Listinvalid input: '<'eitherIResolvableorCfnLaunchTemplate.LaunchTemplateElasticInferenceAcceleratorProperty>default ObjectIndicates whether the instance is enabled for AWS Nitro Enclaves.default ObjectIndicates whether an instance is enabled for hibernation.default ObjectThe name or Amazon Resource Name (ARN) of an IAM instance profile.default StringThe ID of the AMI.default StringIndicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).default ObjectThe market (purchasing) option for the instances.default ObjectThe attributes for the instance types.default StringThe instance type.default StringThe ID of the kernel.default StringThe name of the key pair.default ObjectThe license configurations.default ObjectThe maintenance options of your instance.default ObjectThe metadata options for the instance.default ObjectThe monitoring for the instance.default ObjectThe network interfaces for the instance.default ObjectThe settings for the network performance options for the instance.default ObjectThe placement for the instance.default ObjectThe hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled.default StringThe ID of the RAM disk.The IDs of the security groups.The names of the security groups.default ObjectThe tags to apply to resources that are created during instance launch.default StringThe user data to make available to the instance.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getBlockDeviceMappings
The block device mapping.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLaunchTemplate.BlockDeviceMappingProperty>- See Also:
-
getCapacityReservationSpecification
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).Returns union: either
IResolvableorCfnLaunchTemplate.CapacityReservationSpecificationProperty- See Also:
-
getCpuOptions
The CPU options for the instance.For more information, see CPU options for Amazon EC2 instances in the Amazon EC2 User Guide .
Returns union: either
IResolvableorCfnLaunchTemplate.CpuOptionsProperty- See Also:
-
getCreditSpecification
The credit option for CPU usage of the instance.Valid only for T instances.
Returns union: either
IResolvableorCfnLaunchTemplate.CreditSpecificationProperty- See Also:
-
getDisableApiStop
Indicates whether to enable the instance for stop protection.For more information, see Enable stop protection for your EC2 instances in the Amazon EC2 User Guide .
Returns union: either
BooleanorIResolvable- See Also:
-
getDisableApiTermination
Indicates whether termination protection is enabled for the instance.The default is
false, which means that you can terminate the instance using the Amazon EC2 console, command line tools, or API. You can enable termination protection when you launch an instance, while the instance is running, or while the instance is stopped.Returns union: either
BooleanorIResolvable- See Also:
-
getEbsOptimized
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.
Returns union: either
BooleanorIResolvable- See Also:
-
getElasticGpuSpecifications
Returns union: eitherIResolvableor Listinvalid input: '<'eitherIResolvableorCfnLaunchTemplate.ElasticGpuSpecificationProperty>- See Also:
-
getElasticInferenceAccelerators
Returns union: eitherIResolvableor Listinvalid input: '<'eitherIResolvableorCfnLaunchTemplate.LaunchTemplateElasticInferenceAcceleratorProperty>- See Also:
-
getEnclaveOptions
Indicates whether the instance is enabled for AWS Nitro Enclaves.For more information, see What is Nitro Enclaves? in the AWS Nitro Enclaves User Guide .
You can't enable AWS Nitro Enclaves and hibernation on the same instance.
Returns union: either
IResolvableorCfnLaunchTemplate.EnclaveOptionsProperty- See Also:
-
getHibernationOptions
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 Amazon EC2 instance in the Amazon EC2 User Guide .
Returns union: either
IResolvableorCfnLaunchTemplate.HibernationOptionsProperty- See Also:
-
getIamInstanceProfile
The name or Amazon Resource Name (ARN) of an IAM instance profile.Returns union: either
IResolvableorCfnLaunchTemplate.IamInstanceProfileProperty- See Also:
-
getImageId
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-0ac394d6a3exampleresolve:ssm:parameter-nameresolve:ssm:parameter-name:version-numberresolve: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 Also:
-
getInstanceInitiatedShutdownBehavior
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 Also:
-
getInstanceMarketOptions
The market (purchasing) option for the instances.Returns union: either
IResolvableorCfnLaunchTemplate.InstanceMarketOptionsProperty- See Also:
-
getInstanceRequirements
The attributes for the instance types.When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.
You must specify
VCpuCountandMemoryMiB. 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 specifyInstanceType.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 Specify attributes for instance type selection for EC2 Fleet or Spot Fleet and Spot placement score in the Amazon EC2 User Guide .
Returns union: either
IResolvableorCfnLaunchTemplate.InstanceRequirementsProperty- See Also:
-
getInstanceType
The instance type. For more information, see Amazon EC2 instance types in the Amazon EC2 User Guide .If you specify
InstanceType, you can't specifyInstanceRequirements.- See Also:
-
getKernelId
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 Also:
-
getKeyName
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .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 Also:
-
getLicenseSpecifications
The license configurations.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLaunchTemplate.LicenseSpecificationProperty>- See Also:
-
getMaintenanceOptions
The maintenance options of your instance.Returns union: either
IResolvableorCfnLaunchTemplate.MaintenanceOptionsProperty- See Also:
-
getMetadataOptions
The metadata options for the instance.For more information, see Configure the Instance Metadata Service options in the Amazon EC2 User Guide .
Returns union: either
IResolvableorCfnLaunchTemplate.MetadataOptionsProperty- See Also:
-
getMonitoring
The monitoring for the instance.Returns union: either
IResolvableorCfnLaunchTemplate.MonitoringProperty- See Also:
-
getNetworkInterfaces
The network interfaces for the instance.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLaunchTemplate.NetworkInterfaceProperty>- See Also:
-
getNetworkPerformanceOptions
The settings for the network performance options for the instance.For more information, see EC2 instance bandwidth weighting configuration .
Returns union: either
IResolvableorCfnLaunchTemplate.NetworkPerformanceOptionsProperty- See Also:
-
getPlacement
The placement for the instance.Returns union: either
IResolvableorCfnLaunchTemplate.PlacementProperty- See Also:
-
getPrivateDnsNameOptions
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 .
Returns union: either
IResolvableorCfnLaunchTemplate.PrivateDnsNameOptionsProperty- See Also:
-
getRamDiskId
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 EC2 User Guide .
- See Also:
-
getSecurityGroupIds
The IDs of the security groups.You can specify the IDs of existing security groups and references to resources created by the stack template.
If you specify a network interface, you must specify any security groups as part of the network interface instead.
- See Also:
-
getSecurityGroups
The names of the security groups. For a nondefault VPC, you must use security group IDs instead.If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
- See Also:
-
getTagSpecifications
The tags to apply to resources that are created during instance launch.To tag the launch template itself, use TagSpecifications .
Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLaunchTemplate.TagSpecificationProperty>- See Also:
-
getUserData
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 when you launch an EC2 instance with user data input in the Amazon EC2 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 Also:
-
builder
-