
com.pulumi.awsnative.ec2.kotlin.inputs.Ec2FleetSpotOptionsRequestArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.ec2.kotlin.inputs
import com.pulumi.awsnative.ec2.inputs.Ec2FleetSpotOptionsRequestArgs.builder
import com.pulumi.awsnative.ec2.kotlin.enums.Ec2FleetSpotOptionsRequestAllocationStrategy
import com.pulumi.awsnative.ec2.kotlin.enums.Ec2FleetSpotOptionsRequestInstanceInterruptionBehavior
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
*
* @property allocationStrategy Indicates how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the EC2 Fleet.
* If the allocation strategy is `lowestPrice` , EC2 Fleet launches instances from the Spot Instance pools with the lowest price. This is the default allocation strategy.
* If the allocation strategy is `diversified` , EC2 Fleet launches instances from all the Spot Instance pools that you specify.
* If the allocation strategy is `capacityOptimized` , EC2 Fleet launches instances from Spot Instance pools that are optimally chosen based on the available Spot Instance capacity.
* *Allowed Values* : `lowestPrice` | `diversified` | `capacityOptimized` | `capacityOptimizedPrioritized`
* @property instanceInterruptionBehavior The behavior when a Spot Instance is interrupted.
* Default: `terminate`
* @property instancePoolsToUseCount The number of Spot pools across which to allocate your target Spot capacity. Supported only when Spot `AllocationStrategy` is set to `lowest-price` . EC2 Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
* Note that EC2 Fleet attempts to draw Spot Instances from the number of pools that you specify on a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, EC2 Fleet will continue to fulfill your request by drawing from the next cheapest pool. To ensure that your target capacity is met, you might receive Spot Instances from more than the number of pools that you specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target capacity from fewer than the number of pools that you specified.
* @property maintenanceStrategies The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.
* @property maxTotalPrice The maximum amount per hour for Spot Instances that you're willing to pay. 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 Spot Instances will be interrupted more frequently than if you do not specify this parameter. > If your fleet includes T instances that are configured as `unlimited` , and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The `MaxTotalPrice` does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for `MaxTotalPrice` . For more information, see [Surplus credits can incur charges](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits) in the *Amazon EC2 User Guide* .
* @property minTargetCapacity The minimum target capacity for Spot Instances in the fleet. If this minimum capacity isn't reached, no instances are launched.
* Constraints: Maximum value of `1000` . Supported only for fleets of type `instant` .
* At least one of the following must be specified: `SingleAvailabilityZone` | `SingleInstanceType`
* @property singleAvailabilityZone Indicates that the fleet launches all Spot Instances into a single Availability Zone.
* Supported only for fleets of type `instant` .
* @property singleInstanceType Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet.
* Supported only for fleets of type `instant` .
*/
public data class Ec2FleetSpotOptionsRequestArgs(
public val allocationStrategy: Output? = null,
public val instanceInterruptionBehavior: Output? = null,
public val instancePoolsToUseCount: Output? = null,
public val maintenanceStrategies: Output? = null,
public val maxTotalPrice: Output? = null,
public val minTargetCapacity: Output? = null,
public val singleAvailabilityZone: Output? = null,
public val singleInstanceType: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.awsnative.ec2.inputs.Ec2FleetSpotOptionsRequestArgs =
com.pulumi.awsnative.ec2.inputs.Ec2FleetSpotOptionsRequestArgs.builder()
.allocationStrategy(
allocationStrategy?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.instanceInterruptionBehavior(
instanceInterruptionBehavior?.applyValue({ args0 ->
args0.let({ args0 -> args0.toJava() })
}),
)
.instancePoolsToUseCount(instancePoolsToUseCount?.applyValue({ args0 -> args0 }))
.maintenanceStrategies(
maintenanceStrategies?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.maxTotalPrice(maxTotalPrice?.applyValue({ args0 -> args0 }))
.minTargetCapacity(minTargetCapacity?.applyValue({ args0 -> args0 }))
.singleAvailabilityZone(singleAvailabilityZone?.applyValue({ args0 -> args0 }))
.singleInstanceType(singleInstanceType?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [Ec2FleetSpotOptionsRequestArgs].
*/
@PulumiTagMarker
public class Ec2FleetSpotOptionsRequestArgsBuilder internal constructor() {
private var allocationStrategy: Output? = null
private var instanceInterruptionBehavior:
Output? = null
private var instancePoolsToUseCount: Output? = null
private var maintenanceStrategies: Output? = null
private var maxTotalPrice: Output? = null
private var minTargetCapacity: Output? = null
private var singleAvailabilityZone: Output? = null
private var singleInstanceType: Output? = null
/**
* @param value Indicates how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the EC2 Fleet.
* If the allocation strategy is `lowestPrice` , EC2 Fleet launches instances from the Spot Instance pools with the lowest price. This is the default allocation strategy.
* If the allocation strategy is `diversified` , EC2 Fleet launches instances from all the Spot Instance pools that you specify.
* If the allocation strategy is `capacityOptimized` , EC2 Fleet launches instances from Spot Instance pools that are optimally chosen based on the available Spot Instance capacity.
* *Allowed Values* : `lowestPrice` | `diversified` | `capacityOptimized` | `capacityOptimizedPrioritized`
*/
@JvmName("phouimdfjvtjikxp")
public suspend fun allocationStrategy(`value`: Output) {
this.allocationStrategy = value
}
/**
* @param value The behavior when a Spot Instance is interrupted.
* Default: `terminate`
*/
@JvmName("gwcenbrypxbgoeli")
public suspend fun instanceInterruptionBehavior(`value`: Output) {
this.instanceInterruptionBehavior = value
}
/**
* @param value The number of Spot pools across which to allocate your target Spot capacity. Supported only when Spot `AllocationStrategy` is set to `lowest-price` . EC2 Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
* Note that EC2 Fleet attempts to draw Spot Instances from the number of pools that you specify on a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, EC2 Fleet will continue to fulfill your request by drawing from the next cheapest pool. To ensure that your target capacity is met, you might receive Spot Instances from more than the number of pools that you specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target capacity from fewer than the number of pools that you specified.
*/
@JvmName("jehifsyxpdffvrty")
public suspend fun instancePoolsToUseCount(`value`: Output) {
this.instancePoolsToUseCount = value
}
/**
* @param value The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.
*/
@JvmName("yjkfbgfmqoygxkas")
public suspend fun maintenanceStrategies(`value`: Output) {
this.maintenanceStrategies = value
}
/**
* @param value The maximum amount per hour for Spot Instances that you're willing to pay. 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 Spot Instances will be interrupted more frequently than if you do not specify this parameter. > If your fleet includes T instances that are configured as `unlimited` , and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The `MaxTotalPrice` does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for `MaxTotalPrice` . For more information, see [Surplus credits can incur charges](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits) in the *Amazon EC2 User Guide* .
*/
@JvmName("selyxvypaewkrbwj")
public suspend fun maxTotalPrice(`value`: Output) {
this.maxTotalPrice = value
}
/**
* @param value The minimum target capacity for Spot Instances in the fleet. If this minimum capacity isn't reached, no instances are launched.
* Constraints: Maximum value of `1000` . Supported only for fleets of type `instant` .
* At least one of the following must be specified: `SingleAvailabilityZone` | `SingleInstanceType`
*/
@JvmName("ntsauljlpufoabav")
public suspend fun minTargetCapacity(`value`: Output) {
this.minTargetCapacity = value
}
/**
* @param value Indicates that the fleet launches all Spot Instances into a single Availability Zone.
* Supported only for fleets of type `instant` .
*/
@JvmName("nigdsvdidexlomgj")
public suspend fun singleAvailabilityZone(`value`: Output) {
this.singleAvailabilityZone = value
}
/**
* @param value Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet.
* Supported only for fleets of type `instant` .
*/
@JvmName("jxglgelqwjwljidx")
public suspend fun singleInstanceType(`value`: Output) {
this.singleInstanceType = value
}
/**
* @param value Indicates how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the EC2 Fleet.
* If the allocation strategy is `lowestPrice` , EC2 Fleet launches instances from the Spot Instance pools with the lowest price. This is the default allocation strategy.
* If the allocation strategy is `diversified` , EC2 Fleet launches instances from all the Spot Instance pools that you specify.
* If the allocation strategy is `capacityOptimized` , EC2 Fleet launches instances from Spot Instance pools that are optimally chosen based on the available Spot Instance capacity.
* *Allowed Values* : `lowestPrice` | `diversified` | `capacityOptimized` | `capacityOptimizedPrioritized`
*/
@JvmName("sstvtaminxathvfc")
public suspend fun allocationStrategy(`value`: Ec2FleetSpotOptionsRequestAllocationStrategy?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.allocationStrategy = mapped
}
/**
* @param value The behavior when a Spot Instance is interrupted.
* Default: `terminate`
*/
@JvmName("ishropvjfbaaqcen")
public suspend fun instanceInterruptionBehavior(`value`: Ec2FleetSpotOptionsRequestInstanceInterruptionBehavior?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.instanceInterruptionBehavior = mapped
}
/**
* @param value The number of Spot pools across which to allocate your target Spot capacity. Supported only when Spot `AllocationStrategy` is set to `lowest-price` . EC2 Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.
* Note that EC2 Fleet attempts to draw Spot Instances from the number of pools that you specify on a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, EC2 Fleet will continue to fulfill your request by drawing from the next cheapest pool. To ensure that your target capacity is met, you might receive Spot Instances from more than the number of pools that you specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target capacity from fewer than the number of pools that you specified.
*/
@JvmName("jwgiewfrlegwyeie")
public suspend fun instancePoolsToUseCount(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.instancePoolsToUseCount = mapped
}
/**
* @param value The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.
*/
@JvmName("vppjlikksudxvnlg")
public suspend fun maintenanceStrategies(`value`: Ec2FleetMaintenanceStrategiesArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.maintenanceStrategies = mapped
}
/**
* @param argument The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.
*/
@JvmName("uqpanqrdhgakojhl")
public suspend fun maintenanceStrategies(argument: suspend Ec2FleetMaintenanceStrategiesArgsBuilder.() -> Unit) {
val toBeMapped = Ec2FleetMaintenanceStrategiesArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.maintenanceStrategies = mapped
}
/**
* @param value The maximum amount per hour for Spot Instances that you're willing to pay. 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 Spot Instances will be interrupted more frequently than if you do not specify this parameter. > If your fleet includes T instances that are configured as `unlimited` , and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. The `MaxTotalPrice` does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for `MaxTotalPrice` . For more information, see [Surplus credits can incur charges](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits) in the *Amazon EC2 User Guide* .
*/
@JvmName("tbrqedgccacdjtcx")
public suspend fun maxTotalPrice(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.maxTotalPrice = mapped
}
/**
* @param value The minimum target capacity for Spot Instances in the fleet. If this minimum capacity isn't reached, no instances are launched.
* Constraints: Maximum value of `1000` . Supported only for fleets of type `instant` .
* At least one of the following must be specified: `SingleAvailabilityZone` | `SingleInstanceType`
*/
@JvmName("iwndhgqlfombbyby")
public suspend fun minTargetCapacity(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.minTargetCapacity = mapped
}
/**
* @param value Indicates that the fleet launches all Spot Instances into a single Availability Zone.
* Supported only for fleets of type `instant` .
*/
@JvmName("wkymtrfwqavkshjl")
public suspend fun singleAvailabilityZone(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.singleAvailabilityZone = mapped
}
/**
* @param value Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet.
* Supported only for fleets of type `instant` .
*/
@JvmName("kbmbtueacunltjnb")
public suspend fun singleInstanceType(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.singleInstanceType = mapped
}
internal fun build(): Ec2FleetSpotOptionsRequestArgs = Ec2FleetSpotOptionsRequestArgs(
allocationStrategy = allocationStrategy,
instanceInterruptionBehavior = instanceInterruptionBehavior,
instancePoolsToUseCount = instancePoolsToUseCount,
maintenanceStrategies = maintenanceStrategies,
maxTotalPrice = maxTotalPrice,
minTargetCapacity = minTargetCapacity,
singleAvailabilityZone = singleAvailabilityZone,
singleInstanceType = singleInstanceType,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy