All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.ec2.model.RequestLaunchTemplateData Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon EC2 module holds the client classes that are used for communicating with Amazon EC2 Service

The newest version!
/*
 * Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.ec2.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 * 

* The information to include in the launch template. *

* *

* You must specify at least one parameter for the launch template data. *

*
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RequestLaunchTemplateData implements Serializable, Cloneable { /** *

* 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. *

*
*/ private String kernelId; /** *

* 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. *

*/ private Boolean ebsOptimized; /** *

* The name or Amazon Resource Name (ARN) of an IAM instance profile. *

*/ private LaunchTemplateIamInstanceProfileSpecificationRequest iamInstanceProfile; /** *

* The block device mapping. *

*/ private com.amazonaws.internal.SdkInternalList blockDeviceMappings; /** *

* The network interfaces for the instance. *

*/ private com.amazonaws.internal.SdkInternalList networkInterfaces; /** *

* The ID of the AMI in the format ami-17characters00000. *

*

* Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The Systems * Manager parameter will resolve to an AMI ID on launch. *

*

* To reference a public parameter: *

*
    *
  • *

    * resolve:ssm:public-parameter *

    *
  • *
*

* To reference a parameter stored in the same account: *

*
    *
  • *

    * resolve:ssm:parameter-name *

    *
  • *
  • *

    * resolve:ssm:parameter-name:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-name:label *

    *
  • *
*

* To reference a parameter shared from another Amazon Web Services account: *

*
    *
  • *

    * resolve:ssm:parameter-ARN *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:label *

    *
  • *
*

* For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide. *

* *

* If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following: *

*
    *
  • *

    * Only EC2 Fleets of type instant support specifying a Systems Manager parameter. *

    *
  • *
  • *

    * For EC2 Fleets of type maintain or request, or for Spot Fleets, you must specify the * AMI ID. *

    *
  • *
*
*/ private String imageId; /** *

* The instance type. For more information, see Amazon EC2 instance types in * the Amazon EC2 User Guide. *

*

* If you specify InstanceType, you can't specify InstanceRequirements. *

*/ private String instanceType; /** *

* 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. *

*
*/ private String keyName; /** *

* The monitoring for the instance. *

*/ private LaunchTemplatesMonitoringRequest monitoring; /** *

* The placement for the instance. *

*/ private LaunchTemplatePlacementRequest placement; /** *

* 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. *

*
*/ private String ramDiskId; /** *

* If you set this parameter to true, 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 set InstanceInitiatedShutdownBehavior to * terminate, you can terminate the instance by running the shutdown command from the instance. *

*/ private Boolean disableApiTermination; /** *

* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the * operating system command for system shutdown). *

*

* Default: stop *

*/ private String instanceInitiatedShutdownBehavior; /** *

* 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 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 Batch User Guide. *

*/ private String userData; /** *

* The tags to apply to the resources that are created during instance launch. These tags are not applied to the * launch template. *

*/ private com.amazonaws.internal.SdkInternalList tagSpecifications; /** *

* 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. *

*
*/ private com.amazonaws.internal.SdkInternalList elasticGpuSpecifications; /** *

* 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. *

*

* You cannot specify accelerators from different generations in the same request. *

* *

* Starting April 15, 2023, Amazon Web Services 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. *

*
*/ private com.amazonaws.internal.SdkInternalList elasticInferenceAccelerators; /** *

* The IDs of the security groups. *

*

* If you specify a network interface, you must specify any security groups as part of the network interface instead * of using this parameter. *

*/ private com.amazonaws.internal.SdkInternalList securityGroupIds; /** *

* 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. *

*/ private com.amazonaws.internal.SdkInternalList securityGroups; /** *

* The market (purchasing) option for the instances. *

*/ private LaunchTemplateInstanceMarketOptionsRequest instanceMarketOptions; /** *

* The credit option for CPU usage of the instance. Valid only for T instances. *

*/ private CreditSpecificationRequest creditSpecification; /** *

* The CPU options for the instance. For more information, see Optimize CPU options in * the Amazon EC2 User Guide. *

*/ private LaunchTemplateCpuOptionsRequest cpuOptions; /** *

* 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). *

*/ private LaunchTemplateCapacityReservationSpecificationRequest capacityReservationSpecification; /** *

* The license configurations. *

*/ private com.amazonaws.internal.SdkInternalList licenseSpecifications; /** *

* 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. *

*/ private LaunchTemplateHibernationOptionsRequest hibernationOptions; /** *

* The metadata options for the instance. For more information, see Instance metadata and user * data in the Amazon EC2 User Guide. *

*/ private LaunchTemplateInstanceMetadataOptionsRequest metadataOptions; /** *

* Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see What is Amazon Web Services Nitro * Enclaves? in the Amazon Web Services Nitro Enclaves User Guide. *

*

* You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance. *

*/ private LaunchTemplateEnclaveOptionsRequest enclaveOptions; /** *

* The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance * types with these attributes. *

*

* You must specify VCpuCount and MemoryMiB. 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 specify InstanceType. *

*

* 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 Amazon Web Services CloudFormation resource, you can't specify InstanceRequirements. *

*
*

* For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement score in * the Amazon EC2 User Guide. *

*/ private InstanceRequirementsRequest instanceRequirements; /** *

* The options for the instance hostname. The default values are inherited from the subnet. *

*/ private LaunchTemplatePrivateDnsNameOptionsRequest privateDnsNameOptions; /** *

* The maintenance options for the instance. *

*/ private LaunchTemplateInstanceMaintenanceOptionsRequest maintenanceOptions; /** *

* 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. *

*/ private Boolean disableApiStop; /** *

* 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. *

*
* * @param 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. *

*/ public void setKernelId(String kernelId) { this.kernelId = 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. *

*
* * @return 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. *

*/ public String getKernelId() { return this.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. *

*
* * @param 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. *

* @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withKernelId(String kernelId) { setKernelId(kernelId); return this; } /** *

* 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. *

* * @param 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. */ public void setEbsOptimized(Boolean ebsOptimized) { this.ebsOptimized = 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. *

* * @return 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. */ public Boolean getEbsOptimized() { return this.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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withEbsOptimized(Boolean ebsOptimized) { setEbsOptimized(ebsOptimized); return this; } /** *

* 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. *

* * @return 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. */ public Boolean isEbsOptimized() { return this.ebsOptimized; } /** *

* The name or Amazon Resource Name (ARN) of an IAM instance profile. *

* * @param iamInstanceProfile * The name or Amazon Resource Name (ARN) of an IAM instance profile. */ public void setIamInstanceProfile(LaunchTemplateIamInstanceProfileSpecificationRequest iamInstanceProfile) { this.iamInstanceProfile = iamInstanceProfile; } /** *

* The name or Amazon Resource Name (ARN) of an IAM instance profile. *

* * @return The name or Amazon Resource Name (ARN) of an IAM instance profile. */ public LaunchTemplateIamInstanceProfileSpecificationRequest getIamInstanceProfile() { return this.iamInstanceProfile; } /** *

* The name or Amazon Resource Name (ARN) of an IAM instance profile. *

* * @param iamInstanceProfile * The name or Amazon Resource Name (ARN) of an IAM instance profile. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withIamInstanceProfile(LaunchTemplateIamInstanceProfileSpecificationRequest iamInstanceProfile) { setIamInstanceProfile(iamInstanceProfile); return this; } /** *

* The block device mapping. *

* * @return The block device mapping. */ public java.util.List getBlockDeviceMappings() { if (blockDeviceMappings == null) { blockDeviceMappings = new com.amazonaws.internal.SdkInternalList(); } return blockDeviceMappings; } /** *

* The block device mapping. *

* * @param blockDeviceMappings * The block device mapping. */ public void setBlockDeviceMappings(java.util.Collection blockDeviceMappings) { if (blockDeviceMappings == null) { this.blockDeviceMappings = null; return; } this.blockDeviceMappings = new com.amazonaws.internal.SdkInternalList(blockDeviceMappings); } /** *

* The block device mapping. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setBlockDeviceMappings(java.util.Collection)} or {@link #withBlockDeviceMappings(java.util.Collection)} * if you want to override the existing values. *

* * @param blockDeviceMappings * The block device mapping. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withBlockDeviceMappings(LaunchTemplateBlockDeviceMappingRequest... blockDeviceMappings) { if (this.blockDeviceMappings == null) { setBlockDeviceMappings(new com.amazonaws.internal.SdkInternalList(blockDeviceMappings.length)); } for (LaunchTemplateBlockDeviceMappingRequest ele : blockDeviceMappings) { this.blockDeviceMappings.add(ele); } return this; } /** *

* The block device mapping. *

* * @param blockDeviceMappings * The block device mapping. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withBlockDeviceMappings(java.util.Collection blockDeviceMappings) { setBlockDeviceMappings(blockDeviceMappings); return this; } /** *

* The network interfaces for the instance. *

* * @return The network interfaces for the instance. */ public java.util.List getNetworkInterfaces() { if (networkInterfaces == null) { networkInterfaces = new com.amazonaws.internal.SdkInternalList(); } return networkInterfaces; } /** *

* The network interfaces for the instance. *

* * @param networkInterfaces * The network interfaces for the instance. */ public void setNetworkInterfaces(java.util.Collection networkInterfaces) { if (networkInterfaces == null) { this.networkInterfaces = null; return; } this.networkInterfaces = new com.amazonaws.internal.SdkInternalList(networkInterfaces); } /** *

* The network interfaces for the instance. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setNetworkInterfaces(java.util.Collection)} or {@link #withNetworkInterfaces(java.util.Collection)} if * you want to override the existing values. *

* * @param networkInterfaces * The network interfaces for the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withNetworkInterfaces(LaunchTemplateInstanceNetworkInterfaceSpecificationRequest... networkInterfaces) { if (this.networkInterfaces == null) { setNetworkInterfaces(new com.amazonaws.internal.SdkInternalList( networkInterfaces.length)); } for (LaunchTemplateInstanceNetworkInterfaceSpecificationRequest ele : networkInterfaces) { this.networkInterfaces.add(ele); } return this; } /** *

* The network interfaces for the instance. *

* * @param networkInterfaces * The network interfaces for the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withNetworkInterfaces(java.util.Collection networkInterfaces) { setNetworkInterfaces(networkInterfaces); return this; } /** *

* The ID of the AMI in the format ami-17characters00000. *

*

* Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The Systems * Manager parameter will resolve to an AMI ID on launch. *

*

* To reference a public parameter: *

*
    *
  • *

    * resolve:ssm:public-parameter *

    *
  • *
*

* To reference a parameter stored in the same account: *

*
    *
  • *

    * resolve:ssm:parameter-name *

    *
  • *
  • *

    * resolve:ssm:parameter-name:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-name:label *

    *
  • *
*

* To reference a parameter shared from another Amazon Web Services account: *

*
    *
  • *

    * resolve:ssm:parameter-ARN *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:label *

    *
  • *
*

* For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide. *

* *

* If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following: *

*
    *
  • *

    * Only EC2 Fleets of type instant support specifying a Systems Manager parameter. *

    *
  • *
  • *

    * For EC2 Fleets of type maintain or request, or for Spot Fleets, you must specify the * AMI ID. *

    *
  • *
*
* * @param imageId * The ID of the AMI in the format ami-17characters00000.

*

* Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The * Systems Manager parameter will resolve to an AMI ID on launch. *

*

* To reference a public parameter: *

*
    *
  • *

    * resolve:ssm:public-parameter *

    *
  • *
*

* To reference a parameter stored in the same account: *

*
    *
  • *

    * resolve:ssm:parameter-name *

    *
  • *
  • *

    * resolve:ssm:parameter-name:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-name:label *

    *
  • *
*

* To reference a parameter shared from another Amazon Web Services account: *

*
    *
  • *

    * resolve:ssm:parameter-ARN *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:label *

    *
  • *
*

* For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide. *

* *

* If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following: *

*
    *
  • *

    * Only EC2 Fleets of type instant support specifying a Systems Manager parameter. *

    *
  • *
  • *

    * For EC2 Fleets of type maintain or request, or for Spot Fleets, you must specify * the AMI ID. *

    *
  • *
*/ public void setImageId(String imageId) { this.imageId = imageId; } /** *

* The ID of the AMI in the format ami-17characters00000. *

*

* Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The Systems * Manager parameter will resolve to an AMI ID on launch. *

*

* To reference a public parameter: *

*
    *
  • *

    * resolve:ssm:public-parameter *

    *
  • *
*

* To reference a parameter stored in the same account: *

*
    *
  • *

    * resolve:ssm:parameter-name *

    *
  • *
  • *

    * resolve:ssm:parameter-name:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-name:label *

    *
  • *
*

* To reference a parameter shared from another Amazon Web Services account: *

*
    *
  • *

    * resolve:ssm:parameter-ARN *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:label *

    *
  • *
*

* For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide. *

* *

* If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following: *

*
    *
  • *

    * Only EC2 Fleets of type instant support specifying a Systems Manager parameter. *

    *
  • *
  • *

    * For EC2 Fleets of type maintain or request, or for Spot Fleets, you must specify the * AMI ID. *

    *
  • *
*
* * @return The ID of the AMI in the format ami-17characters00000.

*

* Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The * Systems Manager parameter will resolve to an AMI ID on launch. *

*

* To reference a public parameter: *

*
    *
  • *

    * resolve:ssm:public-parameter *

    *
  • *
*

* To reference a parameter stored in the same account: *

*
    *
  • *

    * resolve:ssm:parameter-name *

    *
  • *
  • *

    * resolve:ssm:parameter-name:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-name:label *

    *
  • *
*

* To reference a parameter shared from another Amazon Web Services account: *

*
    *
  • *

    * resolve:ssm:parameter-ARN *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:label *

    *
  • *
*

* For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide. *

* *

* If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following: *

*
    *
  • *

    * Only EC2 Fleets of type instant support specifying a Systems Manager parameter. *

    *
  • *
  • *

    * For EC2 Fleets of type maintain or request, or for Spot Fleets, you must * specify the AMI ID. *

    *
  • *
*/ public String getImageId() { return this.imageId; } /** *

* The ID of the AMI in the format ami-17characters00000. *

*

* Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The Systems * Manager parameter will resolve to an AMI ID on launch. *

*

* To reference a public parameter: *

*
    *
  • *

    * resolve:ssm:public-parameter *

    *
  • *
*

* To reference a parameter stored in the same account: *

*
    *
  • *

    * resolve:ssm:parameter-name *

    *
  • *
  • *

    * resolve:ssm:parameter-name:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-name:label *

    *
  • *
*

* To reference a parameter shared from another Amazon Web Services account: *

*
    *
  • *

    * resolve:ssm:parameter-ARN *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:label *

    *
  • *
*

* For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide. *

* *

* If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following: *

*
    *
  • *

    * Only EC2 Fleets of type instant support specifying a Systems Manager parameter. *

    *
  • *
  • *

    * For EC2 Fleets of type maintain or request, or for Spot Fleets, you must specify the * AMI ID. *

    *
  • *
*
* * @param imageId * The ID of the AMI in the format ami-17characters00000.

*

* Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The * Systems Manager parameter will resolve to an AMI ID on launch. *

*

* To reference a public parameter: *

*
    *
  • *

    * resolve:ssm:public-parameter *

    *
  • *
*

* To reference a parameter stored in the same account: *

*
    *
  • *

    * resolve:ssm:parameter-name *

    *
  • *
  • *

    * resolve:ssm:parameter-name:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-name:label *

    *
  • *
*

* To reference a parameter shared from another Amazon Web Services account: *

*
    *
  • *

    * resolve:ssm:parameter-ARN *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:version-number *

    *
  • *
  • *

    * resolve:ssm:parameter-ARN:label *

    *
  • *
*

* For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide. *

* *

* If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following: *

*
    *
  • *

    * Only EC2 Fleets of type instant support specifying a Systems Manager parameter. *

    *
  • *
  • *

    * For EC2 Fleets of type maintain or request, or for Spot Fleets, you must specify * the AMI ID. *

    *
  • *
* @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withImageId(String imageId) { setImageId(imageId); return this; } /** *

* The instance type. For more information, see Amazon EC2 instance types in * the Amazon EC2 User Guide. *

*

* If you specify InstanceType, you can't specify InstanceRequirements. *

* * @param instanceType * The instance type. For more information, see Amazon EC2 instance * types in the Amazon EC2 User Guide.

*

* If you specify InstanceType, you can't specify InstanceRequirements. * @see InstanceType */ public void setInstanceType(String instanceType) { this.instanceType = instanceType; } /** *

* The instance type. For more information, see Amazon EC2 instance types in * the Amazon EC2 User Guide. *

*

* If you specify InstanceType, you can't specify InstanceRequirements. *

* * @return The instance type. For more information, see Amazon EC2 instance * types in the Amazon EC2 User Guide.

*

* If you specify InstanceType, you can't specify InstanceRequirements. * @see InstanceType */ public String getInstanceType() { return this.instanceType; } /** *

* The instance type. For more information, see Amazon EC2 instance types in * the Amazon EC2 User Guide. *

*

* If you specify InstanceType, you can't specify InstanceRequirements. *

* * @param instanceType * The instance type. For more information, see Amazon EC2 instance * types in the Amazon EC2 User Guide.

*

* If you specify InstanceType, you can't specify InstanceRequirements. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceType */ public RequestLaunchTemplateData withInstanceType(String instanceType) { setInstanceType(instanceType); return this; } /** *

* The instance type. For more information, see Amazon EC2 instance types in * the Amazon EC2 User Guide. *

*

* If you specify InstanceType, you can't specify InstanceRequirements. *

* * @param instanceType * The instance type. For more information, see Amazon EC2 instance * types in the Amazon EC2 User Guide.

*

* If you specify InstanceType, you can't specify InstanceRequirements. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceType */ public RequestLaunchTemplateData withInstanceType(InstanceType instanceType) { this.instanceType = instanceType.toString(); return this; } /** *

* 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. *

*
* * @param keyName * The name of the key pair. You can create a key pair using CreateKeyPair or * ImportKeyPair.< * /p> *

* 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. *

*/ public void setKeyName(String keyName) { this.keyName = 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. *

*
* * @return 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. *

*/ public String getKeyName() { return this.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. *

*
* * @param keyName * The name of the key pair. You can create a key pair using CreateKeyPair or * ImportKeyPair.< * /p> *

* 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. *

* @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withKeyName(String keyName) { setKeyName(keyName); return this; } /** *

* The monitoring for the instance. *

* * @param monitoring * The monitoring for the instance. */ public void setMonitoring(LaunchTemplatesMonitoringRequest monitoring) { this.monitoring = monitoring; } /** *

* The monitoring for the instance. *

* * @return The monitoring for the instance. */ public LaunchTemplatesMonitoringRequest getMonitoring() { return this.monitoring; } /** *

* The monitoring for the instance. *

* * @param monitoring * The monitoring for the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withMonitoring(LaunchTemplatesMonitoringRequest monitoring) { setMonitoring(monitoring); return this; } /** *

* The placement for the instance. *

* * @param placement * The placement for the instance. */ public void setPlacement(LaunchTemplatePlacementRequest placement) { this.placement = placement; } /** *

* The placement for the instance. *

* * @return The placement for the instance. */ public LaunchTemplatePlacementRequest getPlacement() { return this.placement; } /** *

* The placement for the instance. *

* * @param placement * The placement for the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withPlacement(LaunchTemplatePlacementRequest placement) { setPlacement(placement); return this; } /** *

* 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. *

*
* * @param 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. *

*/ public void setRamDiskId(String ramDiskId) { this.ramDiskId = 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. *

*
* * @return 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. *

*/ public String getRamDiskId() { return this.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. *

*
* * @param 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. *

* @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withRamDiskId(String ramDiskId) { setRamDiskId(ramDiskId); return this; } /** *

* If you set this parameter to true, 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 set InstanceInitiatedShutdownBehavior to * terminate, you can terminate the instance by running the shutdown command from the instance. *

* * @param disableApiTermination * If you set this parameter to true, 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 set InstanceInitiatedShutdownBehavior to * terminate, you can terminate the instance by running the shutdown command from the instance. */ public void setDisableApiTermination(Boolean disableApiTermination) { this.disableApiTermination = disableApiTermination; } /** *

* If you set this parameter to true, 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 set InstanceInitiatedShutdownBehavior to * terminate, you can terminate the instance by running the shutdown command from the instance. *

* * @return If you set this parameter to true, 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 set InstanceInitiatedShutdownBehavior to * terminate, you can terminate the instance by running the shutdown command from the instance. */ public Boolean getDisableApiTermination() { return this.disableApiTermination; } /** *

* If you set this parameter to true, 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 set InstanceInitiatedShutdownBehavior to * terminate, you can terminate the instance by running the shutdown command from the instance. *

* * @param disableApiTermination * If you set this parameter to true, 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 set InstanceInitiatedShutdownBehavior to * terminate, you can terminate the instance by running the shutdown command from the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withDisableApiTermination(Boolean disableApiTermination) { setDisableApiTermination(disableApiTermination); return this; } /** *

* If you set this parameter to true, 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 set InstanceInitiatedShutdownBehavior to * terminate, you can terminate the instance by running the shutdown command from the instance. *

* * @return If you set this parameter to true, 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 set InstanceInitiatedShutdownBehavior to * terminate, you can terminate the instance by running the shutdown command from the instance. */ public Boolean isDisableApiTermination() { return this.disableApiTermination; } /** *

* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the * operating system command for system shutdown). *

*

* Default: stop *

* * @param 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 * @see ShutdownBehavior */ public void setInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) { this.instanceInitiatedShutdownBehavior = 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 *

* * @return 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 ShutdownBehavior */ public String getInstanceInitiatedShutdownBehavior() { return this.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 *

* * @param 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 * @return Returns a reference to this object so that method calls can be chained together. * @see ShutdownBehavior */ public RequestLaunchTemplateData withInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) { setInstanceInitiatedShutdownBehavior(instanceInitiatedShutdownBehavior); return this; } /** *

* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the * operating system command for system shutdown). *

*

* Default: stop *

* * @param 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 * @return Returns a reference to this object so that method calls can be chained together. * @see ShutdownBehavior */ public RequestLaunchTemplateData withInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior) { this.instanceInitiatedShutdownBehavior = instanceInitiatedShutdownBehavior.toString(); return this; } /** *

* 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 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 Batch User Guide. *

* * @param 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 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 Batch User Guide. */ public void setUserData(String userData) { this.userData = 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 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 Batch User Guide. *

* * @return 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 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 Batch User Guide. */ public String getUserData() { return this.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 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 Batch User Guide. *

* * @param 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 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 Batch User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withUserData(String userData) { setUserData(userData); return this; } /** *

* The tags to apply to the resources that are created during instance launch. These tags are not applied to the * launch template. *

* * @return The tags to apply to the resources that are created during instance launch. These tags are not applied to * the launch template. */ public java.util.List getTagSpecifications() { if (tagSpecifications == null) { tagSpecifications = new com.amazonaws.internal.SdkInternalList(); } return tagSpecifications; } /** *

* The tags to apply to the resources that are created during instance launch. These tags are not applied to the * launch template. *

* * @param tagSpecifications * The tags to apply to the resources that are created during instance launch. These tags are not applied to * the launch template. */ public void setTagSpecifications(java.util.Collection tagSpecifications) { if (tagSpecifications == null) { this.tagSpecifications = null; return; } this.tagSpecifications = new com.amazonaws.internal.SdkInternalList(tagSpecifications); } /** *

* The tags to apply to the resources that are created during instance launch. These tags are not applied to the * launch template. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTagSpecifications(java.util.Collection)} or {@link #withTagSpecifications(java.util.Collection)} if * you want to override the existing values. *

* * @param tagSpecifications * The tags to apply to the resources that are created during instance launch. These tags are not applied to * the launch template. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withTagSpecifications(LaunchTemplateTagSpecificationRequest... tagSpecifications) { if (this.tagSpecifications == null) { setTagSpecifications(new com.amazonaws.internal.SdkInternalList(tagSpecifications.length)); } for (LaunchTemplateTagSpecificationRequest ele : tagSpecifications) { this.tagSpecifications.add(ele); } return this; } /** *

* The tags to apply to the resources that are created during instance launch. These tags are not applied to the * launch template. *

* * @param tagSpecifications * The tags to apply to the resources that are created during instance launch. These tags are not applied to * the launch template. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withTagSpecifications(java.util.Collection tagSpecifications) { setTagSpecifications(tagSpecifications); return this; } /** *

* 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. *

*
* * @return 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. *

*/ public java.util.List getElasticGpuSpecifications() { if (elasticGpuSpecifications == null) { elasticGpuSpecifications = new com.amazonaws.internal.SdkInternalList(); } return 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. *

*
* * @param 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. *

*/ public void setElasticGpuSpecifications(java.util.Collection elasticGpuSpecifications) { if (elasticGpuSpecifications == null) { this.elasticGpuSpecifications = null; return; } this.elasticGpuSpecifications = new com.amazonaws.internal.SdkInternalList(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. *

*
*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setElasticGpuSpecifications(java.util.Collection)} or * {@link #withElasticGpuSpecifications(java.util.Collection)} if you want to override the existing values. *

* * @param 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. *

* @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withElasticGpuSpecifications(ElasticGpuSpecification... elasticGpuSpecifications) { if (this.elasticGpuSpecifications == null) { setElasticGpuSpecifications(new com.amazonaws.internal.SdkInternalList(elasticGpuSpecifications.length)); } for (ElasticGpuSpecification ele : elasticGpuSpecifications) { this.elasticGpuSpecifications.add(ele); } return this; } /** *

* 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. *

*
* * @param 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. *

* @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withElasticGpuSpecifications(java.util.Collection elasticGpuSpecifications) { setElasticGpuSpecifications(elasticGpuSpecifications); return this; } /** *

* 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. *

*

* You cannot specify accelerators from different generations in the same request. *

* *

* Starting April 15, 2023, Amazon Web Services 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. *

*
* * @return 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.

*

* You cannot specify accelerators from different generations in the same request. *

* *

* Starting April 15, 2023, Amazon Web Services 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. *

*/ public java.util.List getElasticInferenceAccelerators() { if (elasticInferenceAccelerators == null) { elasticInferenceAccelerators = new com.amazonaws.internal.SdkInternalList(); } return 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. *

*

* You cannot specify accelerators from different generations in the same request. *

* *

* Starting April 15, 2023, Amazon Web Services 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. *

*
* * @param 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.

*

* You cannot specify accelerators from different generations in the same request. *

* *

* Starting April 15, 2023, Amazon Web Services 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. *

*/ public void setElasticInferenceAccelerators(java.util.Collection elasticInferenceAccelerators) { if (elasticInferenceAccelerators == null) { this.elasticInferenceAccelerators = null; return; } this.elasticInferenceAccelerators = new com.amazonaws.internal.SdkInternalList(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. *

*

* You cannot specify accelerators from different generations in the same request. *

* *

* Starting April 15, 2023, Amazon Web Services 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. *

*
*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setElasticInferenceAccelerators(java.util.Collection)} or * {@link #withElasticInferenceAccelerators(java.util.Collection)} if you want to override the existing values. *

* * @param 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.

*

* You cannot specify accelerators from different generations in the same request. *

* *

* Starting April 15, 2023, Amazon Web Services 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. *

* @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withElasticInferenceAccelerators(LaunchTemplateElasticInferenceAccelerator... elasticInferenceAccelerators) { if (this.elasticInferenceAccelerators == null) { setElasticInferenceAccelerators(new com.amazonaws.internal.SdkInternalList( elasticInferenceAccelerators.length)); } for (LaunchTemplateElasticInferenceAccelerator ele : elasticInferenceAccelerators) { this.elasticInferenceAccelerators.add(ele); } return this; } /** *

* 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. *

*

* You cannot specify accelerators from different generations in the same request. *

* *

* Starting April 15, 2023, Amazon Web Services 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. *

*
* * @param 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.

*

* You cannot specify accelerators from different generations in the same request. *

* *

* Starting April 15, 2023, Amazon Web Services 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. *

* @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withElasticInferenceAccelerators( java.util.Collection elasticInferenceAccelerators) { setElasticInferenceAccelerators(elasticInferenceAccelerators); return this; } /** *

* The IDs of the security groups. *

*

* If you specify a network interface, you must specify any security groups as part of the network interface instead * of using this parameter. *

* * @return The IDs of the security groups.

*

* If you specify a network interface, you must specify any security groups as part of the network interface * instead of using this parameter. */ public java.util.List getSecurityGroupIds() { if (securityGroupIds == null) { securityGroupIds = new com.amazonaws.internal.SdkInternalList(); } return securityGroupIds; } /** *

* The IDs of the security groups. *

*

* If you specify a network interface, you must specify any security groups as part of the network interface instead * of using this parameter. *

* * @param securityGroupIds * The IDs of the security groups.

*

* If you specify a network interface, you must specify any security groups as part of the network interface * instead of using this parameter. */ public void setSecurityGroupIds(java.util.Collection securityGroupIds) { if (securityGroupIds == null) { this.securityGroupIds = null; return; } this.securityGroupIds = new com.amazonaws.internal.SdkInternalList(securityGroupIds); } /** *

* The IDs of the security groups. *

*

* If you specify a network interface, you must specify any security groups as part of the network interface instead * of using this parameter. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setSecurityGroupIds(java.util.Collection)} or {@link #withSecurityGroupIds(java.util.Collection)} if you * want to override the existing values. *

* * @param securityGroupIds * The IDs of the security groups.

*

* If you specify a network interface, you must specify any security groups as part of the network interface * instead of using this parameter. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withSecurityGroupIds(String... securityGroupIds) { if (this.securityGroupIds == null) { setSecurityGroupIds(new com.amazonaws.internal.SdkInternalList(securityGroupIds.length)); } for (String ele : securityGroupIds) { this.securityGroupIds.add(ele); } return this; } /** *

* The IDs of the security groups. *

*

* If you specify a network interface, you must specify any security groups as part of the network interface instead * of using this parameter. *

* * @param securityGroupIds * The IDs of the security groups.

*

* If you specify a network interface, you must specify any security groups as part of the network interface * instead of using this parameter. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withSecurityGroupIds(java.util.Collection securityGroupIds) { setSecurityGroupIds(securityGroupIds); return this; } /** *

* 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. *

* * @return 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. */ public java.util.List getSecurityGroups() { if (securityGroups == null) { securityGroups = new com.amazonaws.internal.SdkInternalList(); } return 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. *

* * @param 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. */ public void setSecurityGroups(java.util.Collection securityGroups) { if (securityGroups == null) { this.securityGroups = null; return; } this.securityGroups = new com.amazonaws.internal.SdkInternalList(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. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setSecurityGroups(java.util.Collection)} or {@link #withSecurityGroups(java.util.Collection)} if you want * to override the existing values. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withSecurityGroups(String... securityGroups) { if (this.securityGroups == null) { setSecurityGroups(new com.amazonaws.internal.SdkInternalList(securityGroups.length)); } for (String ele : securityGroups) { this.securityGroups.add(ele); } return this; } /** *

* 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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withSecurityGroups(java.util.Collection securityGroups) { setSecurityGroups(securityGroups); return this; } /** *

* The market (purchasing) option for the instances. *

* * @param instanceMarketOptions * The market (purchasing) option for the instances. */ public void setInstanceMarketOptions(LaunchTemplateInstanceMarketOptionsRequest instanceMarketOptions) { this.instanceMarketOptions = instanceMarketOptions; } /** *

* The market (purchasing) option for the instances. *

* * @return The market (purchasing) option for the instances. */ public LaunchTemplateInstanceMarketOptionsRequest getInstanceMarketOptions() { return this.instanceMarketOptions; } /** *

* The market (purchasing) option for the instances. *

* * @param instanceMarketOptions * The market (purchasing) option for the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withInstanceMarketOptions(LaunchTemplateInstanceMarketOptionsRequest instanceMarketOptions) { setInstanceMarketOptions(instanceMarketOptions); return this; } /** *

* The credit option for CPU usage of the instance. Valid only for T instances. *

* * @param creditSpecification * The credit option for CPU usage of the instance. Valid only for T instances. */ public void setCreditSpecification(CreditSpecificationRequest creditSpecification) { this.creditSpecification = creditSpecification; } /** *

* The credit option for CPU usage of the instance. Valid only for T instances. *

* * @return The credit option for CPU usage of the instance. Valid only for T instances. */ public CreditSpecificationRequest getCreditSpecification() { return this.creditSpecification; } /** *

* The credit option for CPU usage of the instance. Valid only for T instances. *

* * @param creditSpecification * The credit option for CPU usage of the instance. Valid only for T instances. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withCreditSpecification(CreditSpecificationRequest creditSpecification) { setCreditSpecification(creditSpecification); return this; } /** *

* The CPU options for the instance. For more information, see Optimize CPU options in * the Amazon EC2 User Guide. *

* * @param cpuOptions * The CPU options for the instance. For more information, see Optimize CPU * options in the Amazon EC2 User Guide. */ public void setCpuOptions(LaunchTemplateCpuOptionsRequest cpuOptions) { this.cpuOptions = cpuOptions; } /** *

* The CPU options for the instance. For more information, see Optimize CPU options in * the Amazon EC2 User Guide. *

* * @return The CPU options for the instance. For more information, see Optimize CPU * options in the Amazon EC2 User Guide. */ public LaunchTemplateCpuOptionsRequest getCpuOptions() { return this.cpuOptions; } /** *

* The CPU options for the instance. For more information, see Optimize CPU options in * the Amazon EC2 User Guide. *

* * @param cpuOptions * The CPU options for the instance. For more information, see Optimize CPU * options in the Amazon EC2 User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withCpuOptions(LaunchTemplateCpuOptionsRequest cpuOptions) { setCpuOptions(cpuOptions); return this; } /** *

* 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). *

* * @param capacityReservationSpecification * 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). */ public void setCapacityReservationSpecification(LaunchTemplateCapacityReservationSpecificationRequest capacityReservationSpecification) { this.capacityReservationSpecification = capacityReservationSpecification; } /** *

* 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). *

* * @return 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). */ public LaunchTemplateCapacityReservationSpecificationRequest getCapacityReservationSpecification() { return this.capacityReservationSpecification; } /** *

* 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). *

* * @param capacityReservationSpecification * 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). * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withCapacityReservationSpecification(LaunchTemplateCapacityReservationSpecificationRequest capacityReservationSpecification) { setCapacityReservationSpecification(capacityReservationSpecification); return this; } /** *

* The license configurations. *

* * @return The license configurations. */ public java.util.List getLicenseSpecifications() { if (licenseSpecifications == null) { licenseSpecifications = new com.amazonaws.internal.SdkInternalList(); } return licenseSpecifications; } /** *

* The license configurations. *

* * @param licenseSpecifications * The license configurations. */ public void setLicenseSpecifications(java.util.Collection licenseSpecifications) { if (licenseSpecifications == null) { this.licenseSpecifications = null; return; } this.licenseSpecifications = new com.amazonaws.internal.SdkInternalList(licenseSpecifications); } /** *

* The license configurations. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setLicenseSpecifications(java.util.Collection)} or * {@link #withLicenseSpecifications(java.util.Collection)} if you want to override the existing values. *

* * @param licenseSpecifications * The license configurations. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withLicenseSpecifications(LaunchTemplateLicenseConfigurationRequest... licenseSpecifications) { if (this.licenseSpecifications == null) { setLicenseSpecifications(new com.amazonaws.internal.SdkInternalList(licenseSpecifications.length)); } for (LaunchTemplateLicenseConfigurationRequest ele : licenseSpecifications) { this.licenseSpecifications.add(ele); } return this; } /** *

* The license configurations. *

* * @param licenseSpecifications * The license configurations. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withLicenseSpecifications(java.util.Collection licenseSpecifications) { setLicenseSpecifications(licenseSpecifications); return this; } /** *

* 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. *

* * @param 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. */ public void setHibernationOptions(LaunchTemplateHibernationOptionsRequest hibernationOptions) { this.hibernationOptions = 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. *

* * @return 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. */ public LaunchTemplateHibernationOptionsRequest getHibernationOptions() { return this.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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withHibernationOptions(LaunchTemplateHibernationOptionsRequest hibernationOptions) { setHibernationOptions(hibernationOptions); return this; } /** *

* The metadata options for the instance. For more information, see Instance metadata and user * data in the Amazon EC2 User Guide. *

* * @param metadataOptions * The metadata options for the instance. For more information, see Instance metadata * and user data in the Amazon EC2 User Guide. */ public void setMetadataOptions(LaunchTemplateInstanceMetadataOptionsRequest metadataOptions) { this.metadataOptions = metadataOptions; } /** *

* The metadata options for the instance. For more information, see Instance metadata and user * data in the Amazon EC2 User Guide. *

* * @return The metadata options for the instance. For more information, see Instance metadata * and user data in the Amazon EC2 User Guide. */ public LaunchTemplateInstanceMetadataOptionsRequest getMetadataOptions() { return this.metadataOptions; } /** *

* The metadata options for the instance. For more information, see Instance metadata and user * data in the Amazon EC2 User Guide. *

* * @param metadataOptions * The metadata options for the instance. For more information, see Instance metadata * and user data in the Amazon EC2 User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withMetadataOptions(LaunchTemplateInstanceMetadataOptionsRequest metadataOptions) { setMetadataOptions(metadataOptions); return this; } /** *

* Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see What is Amazon Web Services Nitro * Enclaves? in the Amazon Web Services Nitro Enclaves User Guide. *

*

* You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance. *

* * @param enclaveOptions * Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, * see What is Amazon Web * Services Nitro Enclaves? in the Amazon Web Services Nitro Enclaves User Guide.

*

* You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance. */ public void setEnclaveOptions(LaunchTemplateEnclaveOptionsRequest enclaveOptions) { this.enclaveOptions = enclaveOptions; } /** *

* Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see What is Amazon Web Services Nitro * Enclaves? in the Amazon Web Services Nitro Enclaves User Guide. *

*

* You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance. *

* * @return Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, * see What is Amazon Web * Services Nitro Enclaves? in the Amazon Web Services Nitro Enclaves User Guide.

*

* You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance. */ public LaunchTemplateEnclaveOptionsRequest getEnclaveOptions() { return this.enclaveOptions; } /** *

* Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see What is Amazon Web Services Nitro * Enclaves? in the Amazon Web Services Nitro Enclaves User Guide. *

*

* You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance. *

* * @param enclaveOptions * Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, * see What is Amazon Web * Services Nitro Enclaves? in the Amazon Web Services Nitro Enclaves User Guide.

*

* You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withEnclaveOptions(LaunchTemplateEnclaveOptionsRequest enclaveOptions) { setEnclaveOptions(enclaveOptions); return this; } /** *

* The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance * types with these attributes. *

*

* You must specify VCpuCount and MemoryMiB. 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 specify InstanceType. *

*

* 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 Amazon Web Services CloudFormation resource, you can't specify InstanceRequirements. *

*
*

* For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement score in * the Amazon EC2 User Guide. *

* * @param 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 and MemoryMiB. 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 specify InstanceType. *

*

* 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 Amazon Web Services CloudFormation resource, you can't specify * InstanceRequirements. *

*
*

* For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement * score in the Amazon EC2 User Guide. */ public void setInstanceRequirements(InstanceRequirementsRequest instanceRequirements) { this.instanceRequirements = 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 and MemoryMiB. 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 specify InstanceType. *

*

* 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 Amazon Web Services CloudFormation resource, you can't specify InstanceRequirements. *

*
*

* For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement score in * the Amazon EC2 User Guide. *

* * @return The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify * instance types with these attributes.

*

* You must specify VCpuCount and MemoryMiB. 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 specify InstanceType. *

*

* 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 Amazon Web Services CloudFormation resource, you can't specify * InstanceRequirements. *

*
*

* For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement * score in the Amazon EC2 User Guide. */ public InstanceRequirementsRequest getInstanceRequirements() { return this.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 and MemoryMiB. 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 specify InstanceType. *

*

* 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 Amazon Web Services CloudFormation resource, you can't specify InstanceRequirements. *

*
*

* For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement score in * the Amazon EC2 User Guide. *

* * @param 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 and MemoryMiB. 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 specify InstanceType. *

*

* 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 Amazon Web Services CloudFormation resource, you can't specify * InstanceRequirements. *

*
*

* For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement * score in the Amazon EC2 User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withInstanceRequirements(InstanceRequirementsRequest instanceRequirements) { setInstanceRequirements(instanceRequirements); return this; } /** *

* The options for the instance hostname. The default values are inherited from the subnet. *

* * @param privateDnsNameOptions * The options for the instance hostname. The default values are inherited from the subnet. */ public void setPrivateDnsNameOptions(LaunchTemplatePrivateDnsNameOptionsRequest privateDnsNameOptions) { this.privateDnsNameOptions = privateDnsNameOptions; } /** *

* The options for the instance hostname. The default values are inherited from the subnet. *

* * @return The options for the instance hostname. The default values are inherited from the subnet. */ public LaunchTemplatePrivateDnsNameOptionsRequest getPrivateDnsNameOptions() { return this.privateDnsNameOptions; } /** *

* The options for the instance hostname. The default values are inherited from the subnet. *

* * @param privateDnsNameOptions * The options for the instance hostname. The default values are inherited from the subnet. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withPrivateDnsNameOptions(LaunchTemplatePrivateDnsNameOptionsRequest privateDnsNameOptions) { setPrivateDnsNameOptions(privateDnsNameOptions); return this; } /** *

* The maintenance options for the instance. *

* * @param maintenanceOptions * The maintenance options for the instance. */ public void setMaintenanceOptions(LaunchTemplateInstanceMaintenanceOptionsRequest maintenanceOptions) { this.maintenanceOptions = maintenanceOptions; } /** *

* The maintenance options for the instance. *

* * @return The maintenance options for the instance. */ public LaunchTemplateInstanceMaintenanceOptionsRequest getMaintenanceOptions() { return this.maintenanceOptions; } /** *

* The maintenance options for the instance. *

* * @param maintenanceOptions * The maintenance options for the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withMaintenanceOptions(LaunchTemplateInstanceMaintenanceOptionsRequest maintenanceOptions) { setMaintenanceOptions(maintenanceOptions); return this; } /** *

* 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. *

* * @param 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. */ public void setDisableApiStop(Boolean disableApiStop) { this.disableApiStop = 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. *

* * @return 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. */ public Boolean getDisableApiStop() { return this.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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public RequestLaunchTemplateData withDisableApiStop(Boolean disableApiStop) { setDisableApiStop(disableApiStop); return this; } /** *

* 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. *

* * @return 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. */ public Boolean isDisableApiStop() { return this.disableApiStop; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getKernelId() != null) sb.append("KernelId: ").append(getKernelId()).append(","); if (getEbsOptimized() != null) sb.append("EbsOptimized: ").append(getEbsOptimized()).append(","); if (getIamInstanceProfile() != null) sb.append("IamInstanceProfile: ").append(getIamInstanceProfile()).append(","); if (getBlockDeviceMappings() != null) sb.append("BlockDeviceMappings: ").append(getBlockDeviceMappings()).append(","); if (getNetworkInterfaces() != null) sb.append("NetworkInterfaces: ").append(getNetworkInterfaces()).append(","); if (getImageId() != null) sb.append("ImageId: ").append(getImageId()).append(","); if (getInstanceType() != null) sb.append("InstanceType: ").append(getInstanceType()).append(","); if (getKeyName() != null) sb.append("KeyName: ").append(getKeyName()).append(","); if (getMonitoring() != null) sb.append("Monitoring: ").append(getMonitoring()).append(","); if (getPlacement() != null) sb.append("Placement: ").append(getPlacement()).append(","); if (getRamDiskId() != null) sb.append("RamDiskId: ").append(getRamDiskId()).append(","); if (getDisableApiTermination() != null) sb.append("DisableApiTermination: ").append(getDisableApiTermination()).append(","); if (getInstanceInitiatedShutdownBehavior() != null) sb.append("InstanceInitiatedShutdownBehavior: ").append(getInstanceInitiatedShutdownBehavior()).append(","); if (getUserData() != null) sb.append("UserData: ").append("***Sensitive Data Redacted***").append(","); if (getTagSpecifications() != null) sb.append("TagSpecifications: ").append(getTagSpecifications()).append(","); if (getElasticGpuSpecifications() != null) sb.append("ElasticGpuSpecifications: ").append(getElasticGpuSpecifications()).append(","); if (getElasticInferenceAccelerators() != null) sb.append("ElasticInferenceAccelerators: ").append(getElasticInferenceAccelerators()).append(","); if (getSecurityGroupIds() != null) sb.append("SecurityGroupIds: ").append(getSecurityGroupIds()).append(","); if (getSecurityGroups() != null) sb.append("SecurityGroups: ").append(getSecurityGroups()).append(","); if (getInstanceMarketOptions() != null) sb.append("InstanceMarketOptions: ").append(getInstanceMarketOptions()).append(","); if (getCreditSpecification() != null) sb.append("CreditSpecification: ").append(getCreditSpecification()).append(","); if (getCpuOptions() != null) sb.append("CpuOptions: ").append(getCpuOptions()).append(","); if (getCapacityReservationSpecification() != null) sb.append("CapacityReservationSpecification: ").append(getCapacityReservationSpecification()).append(","); if (getLicenseSpecifications() != null) sb.append("LicenseSpecifications: ").append(getLicenseSpecifications()).append(","); if (getHibernationOptions() != null) sb.append("HibernationOptions: ").append(getHibernationOptions()).append(","); if (getMetadataOptions() != null) sb.append("MetadataOptions: ").append(getMetadataOptions()).append(","); if (getEnclaveOptions() != null) sb.append("EnclaveOptions: ").append(getEnclaveOptions()).append(","); if (getInstanceRequirements() != null) sb.append("InstanceRequirements: ").append(getInstanceRequirements()).append(","); if (getPrivateDnsNameOptions() != null) sb.append("PrivateDnsNameOptions: ").append(getPrivateDnsNameOptions()).append(","); if (getMaintenanceOptions() != null) sb.append("MaintenanceOptions: ").append(getMaintenanceOptions()).append(","); if (getDisableApiStop() != null) sb.append("DisableApiStop: ").append(getDisableApiStop()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RequestLaunchTemplateData == false) return false; RequestLaunchTemplateData other = (RequestLaunchTemplateData) obj; if (other.getKernelId() == null ^ this.getKernelId() == null) return false; if (other.getKernelId() != null && other.getKernelId().equals(this.getKernelId()) == false) return false; if (other.getEbsOptimized() == null ^ this.getEbsOptimized() == null) return false; if (other.getEbsOptimized() != null && other.getEbsOptimized().equals(this.getEbsOptimized()) == false) return false; if (other.getIamInstanceProfile() == null ^ this.getIamInstanceProfile() == null) return false; if (other.getIamInstanceProfile() != null && other.getIamInstanceProfile().equals(this.getIamInstanceProfile()) == false) return false; if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == null) return false; if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == false) return false; if (other.getNetworkInterfaces() == null ^ this.getNetworkInterfaces() == null) return false; if (other.getNetworkInterfaces() != null && other.getNetworkInterfaces().equals(this.getNetworkInterfaces()) == false) return false; if (other.getImageId() == null ^ this.getImageId() == null) return false; if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == false) return false; if (other.getInstanceType() == null ^ this.getInstanceType() == null) return false; if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false) return false; if (other.getKeyName() == null ^ this.getKeyName() == null) return false; if (other.getKeyName() != null && other.getKeyName().equals(this.getKeyName()) == false) return false; if (other.getMonitoring() == null ^ this.getMonitoring() == null) return false; if (other.getMonitoring() != null && other.getMonitoring().equals(this.getMonitoring()) == false) return false; if (other.getPlacement() == null ^ this.getPlacement() == null) return false; if (other.getPlacement() != null && other.getPlacement().equals(this.getPlacement()) == false) return false; if (other.getRamDiskId() == null ^ this.getRamDiskId() == null) return false; if (other.getRamDiskId() != null && other.getRamDiskId().equals(this.getRamDiskId()) == false) return false; if (other.getDisableApiTermination() == null ^ this.getDisableApiTermination() == null) return false; if (other.getDisableApiTermination() != null && other.getDisableApiTermination().equals(this.getDisableApiTermination()) == false) return false; if (other.getInstanceInitiatedShutdownBehavior() == null ^ this.getInstanceInitiatedShutdownBehavior() == null) return false; if (other.getInstanceInitiatedShutdownBehavior() != null && other.getInstanceInitiatedShutdownBehavior().equals(this.getInstanceInitiatedShutdownBehavior()) == false) return false; if (other.getUserData() == null ^ this.getUserData() == null) return false; if (other.getUserData() != null && other.getUserData().equals(this.getUserData()) == false) return false; if (other.getTagSpecifications() == null ^ this.getTagSpecifications() == null) return false; if (other.getTagSpecifications() != null && other.getTagSpecifications().equals(this.getTagSpecifications()) == false) return false; if (other.getElasticGpuSpecifications() == null ^ this.getElasticGpuSpecifications() == null) return false; if (other.getElasticGpuSpecifications() != null && other.getElasticGpuSpecifications().equals(this.getElasticGpuSpecifications()) == false) return false; if (other.getElasticInferenceAccelerators() == null ^ this.getElasticInferenceAccelerators() == null) return false; if (other.getElasticInferenceAccelerators() != null && other.getElasticInferenceAccelerators().equals(this.getElasticInferenceAccelerators()) == false) return false; if (other.getSecurityGroupIds() == null ^ this.getSecurityGroupIds() == null) return false; if (other.getSecurityGroupIds() != null && other.getSecurityGroupIds().equals(this.getSecurityGroupIds()) == false) return false; if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null) return false; if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == false) return false; if (other.getInstanceMarketOptions() == null ^ this.getInstanceMarketOptions() == null) return false; if (other.getInstanceMarketOptions() != null && other.getInstanceMarketOptions().equals(this.getInstanceMarketOptions()) == false) return false; if (other.getCreditSpecification() == null ^ this.getCreditSpecification() == null) return false; if (other.getCreditSpecification() != null && other.getCreditSpecification().equals(this.getCreditSpecification()) == false) return false; if (other.getCpuOptions() == null ^ this.getCpuOptions() == null) return false; if (other.getCpuOptions() != null && other.getCpuOptions().equals(this.getCpuOptions()) == false) return false; if (other.getCapacityReservationSpecification() == null ^ this.getCapacityReservationSpecification() == null) return false; if (other.getCapacityReservationSpecification() != null && other.getCapacityReservationSpecification().equals(this.getCapacityReservationSpecification()) == false) return false; if (other.getLicenseSpecifications() == null ^ this.getLicenseSpecifications() == null) return false; if (other.getLicenseSpecifications() != null && other.getLicenseSpecifications().equals(this.getLicenseSpecifications()) == false) return false; if (other.getHibernationOptions() == null ^ this.getHibernationOptions() == null) return false; if (other.getHibernationOptions() != null && other.getHibernationOptions().equals(this.getHibernationOptions()) == false) return false; if (other.getMetadataOptions() == null ^ this.getMetadataOptions() == null) return false; if (other.getMetadataOptions() != null && other.getMetadataOptions().equals(this.getMetadataOptions()) == false) return false; if (other.getEnclaveOptions() == null ^ this.getEnclaveOptions() == null) return false; if (other.getEnclaveOptions() != null && other.getEnclaveOptions().equals(this.getEnclaveOptions()) == false) return false; if (other.getInstanceRequirements() == null ^ this.getInstanceRequirements() == null) return false; if (other.getInstanceRequirements() != null && other.getInstanceRequirements().equals(this.getInstanceRequirements()) == false) return false; if (other.getPrivateDnsNameOptions() == null ^ this.getPrivateDnsNameOptions() == null) return false; if (other.getPrivateDnsNameOptions() != null && other.getPrivateDnsNameOptions().equals(this.getPrivateDnsNameOptions()) == false) return false; if (other.getMaintenanceOptions() == null ^ this.getMaintenanceOptions() == null) return false; if (other.getMaintenanceOptions() != null && other.getMaintenanceOptions().equals(this.getMaintenanceOptions()) == false) return false; if (other.getDisableApiStop() == null ^ this.getDisableApiStop() == null) return false; if (other.getDisableApiStop() != null && other.getDisableApiStop().equals(this.getDisableApiStop()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode()); hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode()); hashCode = prime * hashCode + ((getIamInstanceProfile() == null) ? 0 : getIamInstanceProfile().hashCode()); hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); hashCode = prime * hashCode + ((getNetworkInterfaces() == null) ? 0 : getNetworkInterfaces().hashCode()); hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode()); hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); hashCode = prime * hashCode + ((getKeyName() == null) ? 0 : getKeyName().hashCode()); hashCode = prime * hashCode + ((getMonitoring() == null) ? 0 : getMonitoring().hashCode()); hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode()); hashCode = prime * hashCode + ((getRamDiskId() == null) ? 0 : getRamDiskId().hashCode()); hashCode = prime * hashCode + ((getDisableApiTermination() == null) ? 0 : getDisableApiTermination().hashCode()); hashCode = prime * hashCode + ((getInstanceInitiatedShutdownBehavior() == null) ? 0 : getInstanceInitiatedShutdownBehavior().hashCode()); hashCode = prime * hashCode + ((getUserData() == null) ? 0 : getUserData().hashCode()); hashCode = prime * hashCode + ((getTagSpecifications() == null) ? 0 : getTagSpecifications().hashCode()); hashCode = prime * hashCode + ((getElasticGpuSpecifications() == null) ? 0 : getElasticGpuSpecifications().hashCode()); hashCode = prime * hashCode + ((getElasticInferenceAccelerators() == null) ? 0 : getElasticInferenceAccelerators().hashCode()); hashCode = prime * hashCode + ((getSecurityGroupIds() == null) ? 0 : getSecurityGroupIds().hashCode()); hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getInstanceMarketOptions() == null) ? 0 : getInstanceMarketOptions().hashCode()); hashCode = prime * hashCode + ((getCreditSpecification() == null) ? 0 : getCreditSpecification().hashCode()); hashCode = prime * hashCode + ((getCpuOptions() == null) ? 0 : getCpuOptions().hashCode()); hashCode = prime * hashCode + ((getCapacityReservationSpecification() == null) ? 0 : getCapacityReservationSpecification().hashCode()); hashCode = prime * hashCode + ((getLicenseSpecifications() == null) ? 0 : getLicenseSpecifications().hashCode()); hashCode = prime * hashCode + ((getHibernationOptions() == null) ? 0 : getHibernationOptions().hashCode()); hashCode = prime * hashCode + ((getMetadataOptions() == null) ? 0 : getMetadataOptions().hashCode()); hashCode = prime * hashCode + ((getEnclaveOptions() == null) ? 0 : getEnclaveOptions().hashCode()); hashCode = prime * hashCode + ((getInstanceRequirements() == null) ? 0 : getInstanceRequirements().hashCode()); hashCode = prime * hashCode + ((getPrivateDnsNameOptions() == null) ? 0 : getPrivateDnsNameOptions().hashCode()); hashCode = prime * hashCode + ((getMaintenanceOptions() == null) ? 0 : getMaintenanceOptions().hashCode()); hashCode = prime * hashCode + ((getDisableApiStop() == null) ? 0 : getDisableApiStop().hashCode()); return hashCode; } @Override public RequestLaunchTemplateData clone() { try { return (RequestLaunchTemplateData) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy