Class CfnLaunchTemplate.LaunchTemplateDataProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnLaunchTemplate.LaunchTemplateDataProperty>
- Enclosing interface:
CfnLaunchTemplate.LaunchTemplateDataProperty
CfnLaunchTemplate.LaunchTemplateDataProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionblockDeviceMappings
(List<? extends Object> blockDeviceMappings) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getBlockDeviceMappings()
blockDeviceMappings
(IResolvable blockDeviceMappings) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getBlockDeviceMappings()
build()
Builds the configured instance.capacityReservationSpecification
(IResolvable capacityReservationSpecification) capacityReservationSpecification
(CfnLaunchTemplate.CapacityReservationSpecificationProperty capacityReservationSpecification) cpuOptions
(IResolvable cpuOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getCpuOptions()
cpuOptions
(CfnLaunchTemplate.CpuOptionsProperty cpuOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getCpuOptions()
creditSpecification
(IResolvable creditSpecification) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getCreditSpecification()
creditSpecification
(CfnLaunchTemplate.CreditSpecificationProperty creditSpecification) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getCreditSpecification()
disableApiStop
(Boolean disableApiStop) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getDisableApiStop()
disableApiStop
(IResolvable disableApiStop) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getDisableApiStop()
disableApiTermination
(Boolean disableApiTermination) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getDisableApiTermination()
disableApiTermination
(IResolvable disableApiTermination) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getDisableApiTermination()
ebsOptimized
(Boolean ebsOptimized) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getEbsOptimized()
ebsOptimized
(IResolvable ebsOptimized) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getEbsOptimized()
elasticGpuSpecifications
(List<? extends Object> elasticGpuSpecifications) elasticGpuSpecifications
(IResolvable elasticGpuSpecifications) elasticInferenceAccelerators
(List<? extends Object> elasticInferenceAccelerators) elasticInferenceAccelerators
(IResolvable elasticInferenceAccelerators) enclaveOptions
(IResolvable enclaveOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getEnclaveOptions()
enclaveOptions
(CfnLaunchTemplate.EnclaveOptionsProperty enclaveOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getEnclaveOptions()
hibernationOptions
(IResolvable hibernationOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getHibernationOptions()
hibernationOptions
(CfnLaunchTemplate.HibernationOptionsProperty hibernationOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getHibernationOptions()
iamInstanceProfile
(IResolvable iamInstanceProfile) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getIamInstanceProfile()
iamInstanceProfile
(CfnLaunchTemplate.IamInstanceProfileProperty iamInstanceProfile) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getIamInstanceProfile()
Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getImageId()
instanceInitiatedShutdownBehavior
(String instanceInitiatedShutdownBehavior) instanceMarketOptions
(IResolvable instanceMarketOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getInstanceMarketOptions()
instanceMarketOptions
(CfnLaunchTemplate.InstanceMarketOptionsProperty instanceMarketOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getInstanceMarketOptions()
instanceRequirements
(IResolvable instanceRequirements) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getInstanceRequirements()
instanceRequirements
(CfnLaunchTemplate.InstanceRequirementsProperty instanceRequirements) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getInstanceRequirements()
instanceType
(String instanceType) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getInstanceType()
Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getKernelId()
Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getKeyName()
licenseSpecifications
(List<? extends Object> licenseSpecifications) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getLicenseSpecifications()
licenseSpecifications
(IResolvable licenseSpecifications) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getLicenseSpecifications()
maintenanceOptions
(IResolvable maintenanceOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMaintenanceOptions()
maintenanceOptions
(CfnLaunchTemplate.MaintenanceOptionsProperty maintenanceOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMaintenanceOptions()
metadataOptions
(IResolvable metadataOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMetadataOptions()
metadataOptions
(CfnLaunchTemplate.MetadataOptionsProperty metadataOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMetadataOptions()
monitoring
(IResolvable monitoring) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMonitoring()
monitoring
(CfnLaunchTemplate.MonitoringProperty monitoring) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMonitoring()
networkInterfaces
(List<? extends Object> networkInterfaces) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getNetworkInterfaces()
networkInterfaces
(IResolvable networkInterfaces) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getNetworkInterfaces()
placement
(IResolvable placement) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getPlacement()
placement
(CfnLaunchTemplate.PlacementProperty placement) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getPlacement()
privateDnsNameOptions
(IResolvable privateDnsNameOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getPrivateDnsNameOptions()
privateDnsNameOptions
(CfnLaunchTemplate.PrivateDnsNameOptionsProperty privateDnsNameOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getPrivateDnsNameOptions()
Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getRamDiskId()
securityGroupIds
(List<String> securityGroupIds) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getSecurityGroupIds()
securityGroups
(List<String> securityGroups) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getSecurityGroups()
tagSpecifications
(List<? extends Object> tagSpecifications) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getTagSpecifications()
tagSpecifications
(IResolvable tagSpecifications) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getTagSpecifications()
Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getUserData()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
blockDeviceMappings
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder blockDeviceMappings(IResolvable blockDeviceMappings) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getBlockDeviceMappings()
- Parameters:
blockDeviceMappings
- The block device mapping.- Returns:
this
-
blockDeviceMappings
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder blockDeviceMappings(List<? extends Object> blockDeviceMappings) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getBlockDeviceMappings()
- Parameters:
blockDeviceMappings
- The block device mapping.- Returns:
this
-
capacityReservationSpecification
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder capacityReservationSpecification(IResolvable capacityReservationSpecification) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getCapacityReservationSpecification()
- Parameters:
capacityReservationSpecification
- The Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults toopen
, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).- Returns:
this
-
capacityReservationSpecification
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder capacityReservationSpecification(CfnLaunchTemplate.CapacityReservationSpecificationProperty capacityReservationSpecification) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getCapacityReservationSpecification()
- Parameters:
capacityReservationSpecification
- The Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults toopen
, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).- Returns:
this
-
cpuOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder cpuOptions(IResolvable cpuOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getCpuOptions()
- Parameters:
cpuOptions
- The CPU options for the instance. For more information, see Optimize CPU options in the Amazon EC2 User Guide .- Returns:
this
-
cpuOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder cpuOptions(CfnLaunchTemplate.CpuOptionsProperty cpuOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getCpuOptions()
- Parameters:
cpuOptions
- The CPU options for the instance. For more information, see Optimize CPU options in the Amazon EC2 User Guide .- Returns:
this
-
creditSpecification
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder creditSpecification(IResolvable creditSpecification) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getCreditSpecification()
- Parameters:
creditSpecification
- The credit option for CPU usage of the instance. Valid only for T instances.- Returns:
this
-
creditSpecification
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder creditSpecification(CfnLaunchTemplate.CreditSpecificationProperty creditSpecification) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getCreditSpecification()
- Parameters:
creditSpecification
- The credit option for CPU usage of the instance. Valid only for T instances.- Returns:
this
-
disableApiStop
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder disableApiStop(Boolean disableApiStop) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getDisableApiStop()
- Parameters:
disableApiStop
- Indicates whether to enable the instance for stop protection. For more information, see Enable stop protection for your instance in the Amazon EC2 User Guide .- Returns:
this
-
disableApiStop
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder disableApiStop(IResolvable disableApiStop) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getDisableApiStop()
- Parameters:
disableApiStop
- Indicates whether to enable the instance for stop protection. For more information, see Enable stop protection for your instance in the Amazon EC2 User Guide .- Returns:
this
-
disableApiTermination
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder disableApiTermination(Boolean disableApiTermination) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getDisableApiTermination()
- Parameters:
disableApiTermination
- If you set this parameter totrue
, you can't terminate the instance using the Amazon EC2 console, CLI, or API;. otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you setInstanceInitiatedShutdownBehavior
toterminate
, you can terminate the instance by running the shutdown command from the instance.- Returns:
this
-
disableApiTermination
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder disableApiTermination(IResolvable disableApiTermination) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getDisableApiTermination()
- Parameters:
disableApiTermination
- If you set this parameter totrue
, you can't terminate the instance using the Amazon EC2 console, CLI, or API;. otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you setInstanceInitiatedShutdownBehavior
toterminate
, you can terminate the instance by running the shutdown command from the instance.- Returns:
this
-
ebsOptimized
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder ebsOptimized(Boolean ebsOptimized) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getEbsOptimized()
- Parameters:
ebsOptimized
- 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:
this
-
ebsOptimized
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder ebsOptimized(IResolvable ebsOptimized) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getEbsOptimized()
- Parameters:
ebsOptimized
- 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:
this
-
elasticGpuSpecifications
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder elasticGpuSpecifications(IResolvable elasticGpuSpecifications) - Parameters:
elasticGpuSpecifications
- Deprecated.Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.
- Returns:
this
-
elasticGpuSpecifications
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder elasticGpuSpecifications(List<? extends Object> elasticGpuSpecifications) - Parameters:
elasticGpuSpecifications
- Deprecated.Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.
- Returns:
this
-
elasticInferenceAccelerators
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder elasticInferenceAccelerators(IResolvable elasticInferenceAccelerators) - Parameters:
elasticInferenceAccelerators
-
An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.Amazon Elastic Inference is no longer available.
You cannot specify accelerators from different generations in the same request.
Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.
- Returns:
this
-
elasticInferenceAccelerators
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder elasticInferenceAccelerators(List<? extends Object> elasticInferenceAccelerators) - Parameters:
elasticInferenceAccelerators
-
An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.Amazon Elastic Inference is no longer available.
You cannot specify accelerators from different generations in the same request.
Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.
- Returns:
this
-
enclaveOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder enclaveOptions(IResolvable enclaveOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getEnclaveOptions()
- Parameters:
enclaveOptions
- Indicates whether the instance is enabled for AWS Nitro Enclaves. For more information, see What is AWS Nitro Enclaves? in the AWS Nitro Enclaves User Guide .You can't enable AWS Nitro Enclaves and hibernation on the same instance.
- Returns:
this
-
enclaveOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder enclaveOptions(CfnLaunchTemplate.EnclaveOptionsProperty enclaveOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getEnclaveOptions()
- Parameters:
enclaveOptions
- Indicates whether the instance is enabled for AWS Nitro Enclaves. For more information, see What is AWS Nitro Enclaves? in the AWS Nitro Enclaves User Guide .You can't enable AWS Nitro Enclaves and hibernation on the same instance.
- Returns:
this
-
hibernationOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder hibernationOptions(IResolvable hibernationOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getHibernationOptions()
- Parameters:
hibernationOptions
- 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:
this
-
hibernationOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder hibernationOptions(CfnLaunchTemplate.HibernationOptionsProperty hibernationOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getHibernationOptions()
- Parameters:
hibernationOptions
- 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:
this
-
iamInstanceProfile
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder iamInstanceProfile(IResolvable iamInstanceProfile) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getIamInstanceProfile()
- Parameters:
iamInstanceProfile
- The name or Amazon Resource Name (ARN) of an IAM instance profile.- Returns:
this
-
iamInstanceProfile
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder iamInstanceProfile(CfnLaunchTemplate.IamInstanceProfileProperty iamInstanceProfile) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getIamInstanceProfile()
- Parameters:
iamInstanceProfile
- The name or Amazon Resource Name (ARN) of an IAM instance profile.- Returns:
this
-
imageId
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder imageId(String imageId) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getImageId()
- Parameters:
imageId
- 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-0ac394d6a3example
resolve:ssm:parameter-name
resolve:ssm:parameter-name:version-number
resolve: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 .
- Returns:
this
-
instanceInitiatedShutdownBehavior
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder instanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getInstanceInitiatedShutdownBehavior()
- Parameters:
instanceInitiatedShutdownBehavior
- Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown). Default:stop
- Returns:
this
-
instanceMarketOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder instanceMarketOptions(IResolvable instanceMarketOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getInstanceMarketOptions()
- Parameters:
instanceMarketOptions
- The market (purchasing) option for the instances.- Returns:
this
-
instanceMarketOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder instanceMarketOptions(CfnLaunchTemplate.InstanceMarketOptionsProperty instanceMarketOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getInstanceMarketOptions()
- Parameters:
instanceMarketOptions
- The market (purchasing) option for the instances.- Returns:
this
-
instanceRequirements
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder instanceRequirements(IResolvable instanceRequirements) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getInstanceRequirements()
- Parameters:
instanceRequirements
- The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.You must specify
VCpuCount
andMemoryMiB
. 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:
this
-
instanceRequirements
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder instanceRequirements(CfnLaunchTemplate.InstanceRequirementsProperty instanceRequirements) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getInstanceRequirements()
- Parameters:
instanceRequirements
- The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.You must specify
VCpuCount
andMemoryMiB
. 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:
this
-
instanceType
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder instanceType(String instanceType) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getInstanceType()
- Parameters:
instanceType
- The instance type. For more information, see Amazon EC2 instance types in the Amazon EC2 User Guide . If you specifyInstanceType
, you can't specifyInstanceRequirements
.- Returns:
this
-
kernelId
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder kernelId(String kernelId) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getKernelId()
- Parameters:
kernelId
- 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 .- Returns:
this
-
keyName
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder keyName(String keyName) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getKeyName()
- Parameters:
keyName
- 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.
- Returns:
this
-
licenseSpecifications
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder licenseSpecifications(IResolvable licenseSpecifications) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getLicenseSpecifications()
- Parameters:
licenseSpecifications
- The license configurations.- Returns:
this
-
licenseSpecifications
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder licenseSpecifications(List<? extends Object> licenseSpecifications) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getLicenseSpecifications()
- Parameters:
licenseSpecifications
- The license configurations.- Returns:
this
-
maintenanceOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder maintenanceOptions(IResolvable maintenanceOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMaintenanceOptions()
- Parameters:
maintenanceOptions
- The maintenance options of your instance.- Returns:
this
-
maintenanceOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder maintenanceOptions(CfnLaunchTemplate.MaintenanceOptionsProperty maintenanceOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMaintenanceOptions()
- Parameters:
maintenanceOptions
- The maintenance options of your instance.- Returns:
this
-
metadataOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder metadataOptions(IResolvable metadataOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMetadataOptions()
- Parameters:
metadataOptions
- The metadata options for the instance. For more information, see Instance metadata and user data in the Amazon EC2 User Guide .- Returns:
this
-
metadataOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder metadataOptions(CfnLaunchTemplate.MetadataOptionsProperty metadataOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMetadataOptions()
- Parameters:
metadataOptions
- The metadata options for the instance. For more information, see Instance metadata and user data in the Amazon EC2 User Guide .- Returns:
this
-
monitoring
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder monitoring(IResolvable monitoring) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMonitoring()
- Parameters:
monitoring
- The monitoring for the instance.- Returns:
this
-
monitoring
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder monitoring(CfnLaunchTemplate.MonitoringProperty monitoring) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getMonitoring()
- Parameters:
monitoring
- The monitoring for the instance.- Returns:
this
-
networkInterfaces
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder networkInterfaces(IResolvable networkInterfaces) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getNetworkInterfaces()
- Parameters:
networkInterfaces
- The network interfaces for the instance.- Returns:
this
-
networkInterfaces
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder networkInterfaces(List<? extends Object> networkInterfaces) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getNetworkInterfaces()
- Parameters:
networkInterfaces
- The network interfaces for the instance.- Returns:
this
-
placement
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder placement(IResolvable placement) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getPlacement()
- Parameters:
placement
- The placement for the instance.- Returns:
this
-
placement
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder placement(CfnLaunchTemplate.PlacementProperty placement) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getPlacement()
- Parameters:
placement
- The placement for the instance.- Returns:
this
-
privateDnsNameOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder privateDnsNameOptions(IResolvable privateDnsNameOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getPrivateDnsNameOptions()
- Parameters:
privateDnsNameOptions
- 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:
this
-
privateDnsNameOptions
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder privateDnsNameOptions(CfnLaunchTemplate.PrivateDnsNameOptionsProperty privateDnsNameOptions) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getPrivateDnsNameOptions()
- Parameters:
privateDnsNameOptions
- 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:
this
-
ramDiskId
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder ramDiskId(String ramDiskId) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getRamDiskId()
- Parameters:
ramDiskId
- 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 .
- Returns:
this
-
securityGroupIds
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder securityGroupIds(List<String> securityGroupIds) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getSecurityGroupIds()
- Parameters:
securityGroupIds
- 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.
- Returns:
this
-
securityGroups
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder securityGroups(List<String> securityGroups) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getSecurityGroups()
- Parameters:
securityGroups
- 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.- Returns:
this
-
tagSpecifications
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder tagSpecifications(IResolvable tagSpecifications) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getTagSpecifications()
- Parameters:
tagSpecifications
- The tags to apply to resources that are created during instance launch. To tag the launch template itself, use TagSpecifications .- Returns:
this
-
tagSpecifications
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder tagSpecifications(List<? extends Object> tagSpecifications) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getTagSpecifications()
- Parameters:
tagSpecifications
- The tags to apply to resources that are created during instance launch. To tag the launch template itself, use TagSpecifications .- Returns:
this
-
userData
@Stability(Stable) public CfnLaunchTemplate.LaunchTemplateDataProperty.Builder userData(String userData) Sets the value ofCfnLaunchTemplate.LaunchTemplateDataProperty.getUserData()
- Parameters:
userData
- 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 on your Amazon EC2 instance at launch 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 .
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnLaunchTemplate.LaunchTemplateDataProperty>
- Returns:
- a new instance of
CfnLaunchTemplate.LaunchTemplateDataProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-