/* * Copyright 2018-2023 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; /** *
* Describes overrides for a launch template. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class LaunchTemplateOverrides implements Serializable, Cloneable { /** ** The instance type. *
*/ private String instanceType; /** ** The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this * parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the * current Spot price. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify * this parameter. *
** The ID of the subnet in which to launch the instances. *
*/ private String subnetId; /** ** The Availability Zone in which to launch the instances. *
*/ private String availabilityZone; /** ** The number of units provided by the specified instance type. *
*/ private Double weightedCapacity; /** ** The priority for the launch template override. The highest priority is launched first. *
*
* If OnDemandAllocationStrategy
is set to prioritized
, Spot Fleet uses priority to
* determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacityOptimizedPrioritized
, Spot Fleet uses
* priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity,
* but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority. If no
* number is set, the launch template override has the lowest priority. You can set the same priority for different
* launch template overrides.
*
* The instance requirements. When you specify instance requirements, Amazon EC2 will identify instance types with * the provided requirements, and then use your On-Demand and Spot allocation strategies to launch instances from * these instance types, in the same way as when you specify a list of instance types. *
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* The instance type. *
* * @param instanceType * The instance type. * @see InstanceType */ public void setInstanceType(String instanceType) { this.instanceType = instanceType; } /** ** The instance type. *
* * @return The instance type. * @see InstanceType */ public String getInstanceType() { return this.instanceType; } /** ** The instance type. *
* * @param instanceType * The instance type. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceType */ public LaunchTemplateOverrides withInstanceType(String instanceType) { setInstanceType(instanceType); return this; } /** ** The instance type. *
* * @param instanceType * The instance type. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceType */ public LaunchTemplateOverrides withInstanceType(InstanceType instanceType) { this.instanceType = instanceType.toString(); return this; } /** ** The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this * parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the * current Spot price. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify * this parameter. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not * specify this parameter. *
*/ public void setSpotPrice(String spotPrice) { this.spotPrice = spotPrice; } /** ** The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this * parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the * current Spot price. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify * this parameter. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not * specify this parameter. *
*/ public String getSpotPrice() { return this.spotPrice; } /** ** The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this * parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the * current Spot price. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify * this parameter. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not * specify this parameter. *
* @return Returns a reference to this object so that method calls can be chained together. */ public LaunchTemplateOverrides withSpotPrice(String spotPrice) { setSpotPrice(spotPrice); return this; } /** ** The ID of the subnet in which to launch the instances. *
* * @param subnetId * The ID of the subnet in which to launch the instances. */ public void setSubnetId(String subnetId) { this.subnetId = subnetId; } /** ** The ID of the subnet in which to launch the instances. *
* * @return The ID of the subnet in which to launch the instances. */ public String getSubnetId() { return this.subnetId; } /** ** The ID of the subnet in which to launch the instances. *
* * @param subnetId * The ID of the subnet in which to launch the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchTemplateOverrides withSubnetId(String subnetId) { setSubnetId(subnetId); return this; } /** ** The Availability Zone in which to launch the instances. *
* * @param availabilityZone * The Availability Zone in which to launch the instances. */ public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } /** ** The Availability Zone in which to launch the instances. *
* * @return The Availability Zone in which to launch the instances. */ public String getAvailabilityZone() { return this.availabilityZone; } /** ** The Availability Zone in which to launch the instances. *
* * @param availabilityZone * The Availability Zone in which to launch the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchTemplateOverrides withAvailabilityZone(String availabilityZone) { setAvailabilityZone(availabilityZone); return this; } /** ** The number of units provided by the specified instance type. *
* * @param weightedCapacity * The number of units provided by the specified instance type. */ public void setWeightedCapacity(Double weightedCapacity) { this.weightedCapacity = weightedCapacity; } /** ** The number of units provided by the specified instance type. *
* * @return The number of units provided by the specified instance type. */ public Double getWeightedCapacity() { return this.weightedCapacity; } /** ** The number of units provided by the specified instance type. *
* * @param weightedCapacity * The number of units provided by the specified instance type. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchTemplateOverrides withWeightedCapacity(Double weightedCapacity) { setWeightedCapacity(weightedCapacity); return this; } /** ** The priority for the launch template override. The highest priority is launched first. *
*
* If OnDemandAllocationStrategy
is set to prioritized
, Spot Fleet uses priority to
* determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacityOptimizedPrioritized
, Spot Fleet uses
* priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity,
* but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority. If no
* number is set, the launch template override has the lowest priority. You can set the same priority for different
* launch template overrides.
*
* If OnDemandAllocationStrategy
is set to prioritized
, Spot Fleet uses priority to
* determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacityOptimizedPrioritized
, Spot
* Fleet uses priority on a best-effort basis to determine which launch template override to use in
* fulfilling Spot capacity, but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority.
* If no number is set, the launch template override has the lowest priority. You can set the same priority
* for different launch template overrides.
*/
public void setPriority(Double priority) {
this.priority = priority;
}
/**
*
* The priority for the launch template override. The highest priority is launched first. *
*
* If OnDemandAllocationStrategy
is set to prioritized
, Spot Fleet uses priority to
* determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacityOptimizedPrioritized
, Spot Fleet uses
* priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity,
* but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority. If no
* number is set, the launch template override has the lowest priority. You can set the same priority for different
* launch template overrides.
*
* If OnDemandAllocationStrategy
is set to prioritized
, Spot Fleet uses priority
* to determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacityOptimizedPrioritized
, Spot
* Fleet uses priority on a best-effort basis to determine which launch template override to use in
* fulfilling Spot capacity, but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority.
* If no number is set, the launch template override has the lowest priority. You can set the same priority
* for different launch template overrides.
*/
public Double getPriority() {
return this.priority;
}
/**
*
* The priority for the launch template override. The highest priority is launched first. *
*
* If OnDemandAllocationStrategy
is set to prioritized
, Spot Fleet uses priority to
* determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacityOptimizedPrioritized
, Spot Fleet uses
* priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity,
* but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority. If no
* number is set, the launch template override has the lowest priority. You can set the same priority for different
* launch template overrides.
*
* If OnDemandAllocationStrategy
is set to prioritized
, Spot Fleet uses priority to
* determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacityOptimizedPrioritized
, Spot
* Fleet uses priority on a best-effort basis to determine which launch template override to use in
* fulfilling Spot capacity, but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority.
* If no number is set, the launch template override has the lowest priority. You can set the same priority
* for different launch template overrides.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchTemplateOverrides withPriority(Double priority) {
setPriority(priority);
return this;
}
/**
*
* The instance requirements. When you specify instance requirements, Amazon EC2 will identify instance types with * the provided requirements, and then use your On-Demand and Spot allocation strategies to launch instances from * these instance types, in the same way as when you specify a list of instance types. *
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* The instance requirements. When you specify instance requirements, Amazon EC2 will identify instance types with * the provided requirements, and then use your On-Demand and Spot allocation strategies to launch instances from * these instance types, in the same way as when you specify a list of instance types. *
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* The instance requirements. When you specify instance requirements, Amazon EC2 will identify instance types with * the provided requirements, and then use your On-Demand and Spot allocation strategies to launch instances from * these instance types, in the same way as when you specify a list of instance types. *
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*