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

com.pulumi.awsnative.ec2.kotlin.CapacityReservationFleetArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.awsnative.ec2.CapacityReservationFleetArgs.builder
import com.pulumi.awsnative.ec2.kotlin.enums.CapacityReservationFleetInstanceMatchCriteria
import com.pulumi.awsnative.ec2.kotlin.enums.CapacityReservationFleetTenancy
import com.pulumi.awsnative.ec2.kotlin.inputs.CapacityReservationFleetInstanceTypeSpecificationArgs
import com.pulumi.awsnative.ec2.kotlin.inputs.CapacityReservationFleetInstanceTypeSpecificationArgsBuilder
import com.pulumi.awsnative.ec2.kotlin.inputs.CapacityReservationFleetTagSpecificationArgs
import com.pulumi.awsnative.ec2.kotlin.inputs.CapacityReservationFleetTagSpecificationArgsBuilder
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.collections.List
import kotlin.jvm.JvmName

/**
 * Resource Type definition for AWS::EC2::CapacityReservationFleet
 * ## Example Usage
 * ### Example
 * No Java example available.
 * @property allocationStrategy The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use. Currently, only the `prioritized` allocation strategy is supported. For more information, see [Allocation strategy](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#allocation-strategy) in the *Amazon EC2 User Guide* .
 * Valid values: `prioritized`
 * @property endDate The date and time at which the Capacity Reservation Fleet expires. When the Capacity Reservation Fleet expires, its state changes to `expired` and all of the Capacity Reservations in the Fleet expire.
 * The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you specify `5/31/2019` , `13:30:55` , the Capacity Reservation Fleet is guaranteed to expire between `13:30:55` and `14:30:55` on `5/31/2019` .
 * @property instanceMatchCriteria Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in the Fleet inherit this instance matching criteria.
 * Currently, Capacity Reservation Fleets support `open` instance matching criteria only. This means that instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its reserved capacity.
 * @property instanceTypeSpecifications Information about the instance types for which to reserve the capacity.
 * @property noRemoveEndDate Used to add an end date to a Capacity Reservation Fleet that has no end date and time. To add an end date to a Capacity Reservation Fleet, specify `true` for this paramater and specify the end date and time (in UTC time format) for the *EndDate* parameter.
 * @property removeEndDate Used to remove an end date from a Capacity Reservation Fleet that is configured to end automatically at a specific date and time. To remove the end date from a Capacity Reservation Fleet, specify `true` for this paramater and omit the *EndDate* parameter.
 * @property tagSpecifications The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
 * @property tenancy Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings:
 * - `default` - The Capacity Reservation Fleet is created on hardware that is shared with other AWS accounts .
 * - `dedicated` - The Capacity Reservations are created on single-tenant hardware that is dedicated to a single AWS account .
 * @property totalTargetCapacity The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together with the instance type weights that you assign to each instance type used by the Fleet determine the number of instances for which the Fleet reserves capacity. Both values are based on units that make sense for your workload. For more information, see [Total target capacity](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#target-capacity) in the *Amazon EC2 User Guide* .
 */
public data class CapacityReservationFleetArgs(
    public val allocationStrategy: Output? = null,
    public val endDate: Output? = null,
    public val instanceMatchCriteria: Output? = null,
    public val instanceTypeSpecifications: Output>? = null,
    public val noRemoveEndDate: Output? = null,
    public val removeEndDate: Output? = null,
    public val tagSpecifications: Output>? = null,
    public val tenancy: Output? = null,
    public val totalTargetCapacity: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ec2.CapacityReservationFleetArgs =
        com.pulumi.awsnative.ec2.CapacityReservationFleetArgs.builder()
            .allocationStrategy(allocationStrategy?.applyValue({ args0 -> args0 }))
            .endDate(endDate?.applyValue({ args0 -> args0 }))
            .instanceMatchCriteria(
                instanceMatchCriteria?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .instanceTypeSpecifications(
                instanceTypeSpecifications?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .noRemoveEndDate(noRemoveEndDate?.applyValue({ args0 -> args0 }))
            .removeEndDate(removeEndDate?.applyValue({ args0 -> args0 }))
            .tagSpecifications(
                tagSpecifications?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .tenancy(tenancy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .totalTargetCapacity(totalTargetCapacity?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [CapacityReservationFleetArgs].
 */
@PulumiTagMarker
public class CapacityReservationFleetArgsBuilder internal constructor() {
    private var allocationStrategy: Output? = null

    private var endDate: Output? = null

    private var instanceMatchCriteria: Output? = null

    private var instanceTypeSpecifications:
        Output>? = null

    private var noRemoveEndDate: Output? = null

    private var removeEndDate: Output? = null

    private var tagSpecifications: Output>? = null

    private var tenancy: Output? = null

    private var totalTargetCapacity: Output? = null

    /**
     * @param value The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use. Currently, only the `prioritized` allocation strategy is supported. For more information, see [Allocation strategy](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#allocation-strategy) in the *Amazon EC2 User Guide* .
     * Valid values: `prioritized`
     */
    @JvmName("wmvaxtfjicumyavk")
    public suspend fun allocationStrategy(`value`: Output) {
        this.allocationStrategy = value
    }

    /**
     * @param value The date and time at which the Capacity Reservation Fleet expires. When the Capacity Reservation Fleet expires, its state changes to `expired` and all of the Capacity Reservations in the Fleet expire.
     * The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you specify `5/31/2019` , `13:30:55` , the Capacity Reservation Fleet is guaranteed to expire between `13:30:55` and `14:30:55` on `5/31/2019` .
     */
    @JvmName("xstualimjkyjuluk")
    public suspend fun endDate(`value`: Output) {
        this.endDate = value
    }

    /**
     * @param value Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in the Fleet inherit this instance matching criteria.
     * Currently, Capacity Reservation Fleets support `open` instance matching criteria only. This means that instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its reserved capacity.
     */
    @JvmName("erpcmjfkjveiuijc")
    public suspend fun instanceMatchCriteria(`value`: Output) {
        this.instanceMatchCriteria = value
    }

    /**
     * @param value Information about the instance types for which to reserve the capacity.
     */
    @JvmName("cdomrobmbtfsrlgv")
    public suspend fun instanceTypeSpecifications(`value`: Output>) {
        this.instanceTypeSpecifications = value
    }

    @JvmName("xfpwyutrogqvlrhy")
    public suspend fun instanceTypeSpecifications(vararg values: Output) {
        this.instanceTypeSpecifications = Output.all(values.asList())
    }

    /**
     * @param values Information about the instance types for which to reserve the capacity.
     */
    @JvmName("ctvrewwiaewknxhb")
    public suspend fun instanceTypeSpecifications(values: List>) {
        this.instanceTypeSpecifications = Output.all(values)
    }

    /**
     * @param value Used to add an end date to a Capacity Reservation Fleet that has no end date and time. To add an end date to a Capacity Reservation Fleet, specify `true` for this paramater and specify the end date and time (in UTC time format) for the *EndDate* parameter.
     */
    @JvmName("yqxcedwhgdvxxyta")
    public suspend fun noRemoveEndDate(`value`: Output) {
        this.noRemoveEndDate = value
    }

    /**
     * @param value Used to remove an end date from a Capacity Reservation Fleet that is configured to end automatically at a specific date and time. To remove the end date from a Capacity Reservation Fleet, specify `true` for this paramater and omit the *EndDate* parameter.
     */
    @JvmName("rkdncutrgrqewikq")
    public suspend fun removeEndDate(`value`: Output) {
        this.removeEndDate = value
    }

    /**
     * @param value The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
     */
    @JvmName("slnmgrnytwjvaots")
    public suspend fun tagSpecifications(`value`: Output>) {
        this.tagSpecifications = value
    }

    @JvmName("axraaqcufaxivbjp")
    public suspend fun tagSpecifications(vararg values: Output) {
        this.tagSpecifications = Output.all(values.asList())
    }

    /**
     * @param values The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
     */
    @JvmName("ikjvnyuerxlfgljp")
    public suspend fun tagSpecifications(values: List>) {
        this.tagSpecifications = Output.all(values)
    }

    /**
     * @param value Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings:
     * - `default` - The Capacity Reservation Fleet is created on hardware that is shared with other AWS accounts .
     * - `dedicated` - The Capacity Reservations are created on single-tenant hardware that is dedicated to a single AWS account .
     */
    @JvmName("aflanthdoeqxfona")
    public suspend fun tenancy(`value`: Output) {
        this.tenancy = value
    }

    /**
     * @param value The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together with the instance type weights that you assign to each instance type used by the Fleet determine the number of instances for which the Fleet reserves capacity. Both values are based on units that make sense for your workload. For more information, see [Total target capacity](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#target-capacity) in the *Amazon EC2 User Guide* .
     */
    @JvmName("ehnpjeghbqgrbwcu")
    public suspend fun totalTargetCapacity(`value`: Output) {
        this.totalTargetCapacity = value
    }

    /**
     * @param value The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use. Currently, only the `prioritized` allocation strategy is supported. For more information, see [Allocation strategy](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#allocation-strategy) in the *Amazon EC2 User Guide* .
     * Valid values: `prioritized`
     */
    @JvmName("ttpduiydmlhgnanj")
    public suspend fun allocationStrategy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allocationStrategy = mapped
    }

    /**
     * @param value The date and time at which the Capacity Reservation Fleet expires. When the Capacity Reservation Fleet expires, its state changes to `expired` and all of the Capacity Reservations in the Fleet expire.
     * The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you specify `5/31/2019` , `13:30:55` , the Capacity Reservation Fleet is guaranteed to expire between `13:30:55` and `14:30:55` on `5/31/2019` .
     */
    @JvmName("hcwaofqbmjmagvps")
    public suspend fun endDate(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.endDate = mapped
    }

    /**
     * @param value Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in the Fleet inherit this instance matching criteria.
     * Currently, Capacity Reservation Fleets support `open` instance matching criteria only. This means that instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its reserved capacity.
     */
    @JvmName("apbpfiacwvemrhci")
    public suspend fun instanceMatchCriteria(`value`: CapacityReservationFleetInstanceMatchCriteria?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceMatchCriteria = mapped
    }

    /**
     * @param value Information about the instance types for which to reserve the capacity.
     */
    @JvmName("ggcvbhjglgmanvyf")
    public suspend fun instanceTypeSpecifications(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceTypeSpecifications = mapped
    }

    /**
     * @param argument Information about the instance types for which to reserve the capacity.
     */
    @JvmName("qqgxekdpuoejhvrh")
    public suspend fun instanceTypeSpecifications(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            CapacityReservationFleetInstanceTypeSpecificationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.instanceTypeSpecifications = mapped
    }

    /**
     * @param argument Information about the instance types for which to reserve the capacity.
     */
    @JvmName("hppbkdfkocbwhadr")
    public suspend fun instanceTypeSpecifications(vararg argument: suspend CapacityReservationFleetInstanceTypeSpecificationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            CapacityReservationFleetInstanceTypeSpecificationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.instanceTypeSpecifications = mapped
    }

    /**
     * @param argument Information about the instance types for which to reserve the capacity.
     */
    @JvmName("jqgpfeoykdihsywo")
    public suspend fun instanceTypeSpecifications(argument: suspend CapacityReservationFleetInstanceTypeSpecificationArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                CapacityReservationFleetInstanceTypeSpecificationArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.instanceTypeSpecifications = mapped
    }

    /**
     * @param values Information about the instance types for which to reserve the capacity.
     */
    @JvmName("fsqlcssitjxpuslq")
    public suspend fun instanceTypeSpecifications(vararg values: CapacityReservationFleetInstanceTypeSpecificationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.instanceTypeSpecifications = mapped
    }

    /**
     * @param value Used to add an end date to a Capacity Reservation Fleet that has no end date and time. To add an end date to a Capacity Reservation Fleet, specify `true` for this paramater and specify the end date and time (in UTC time format) for the *EndDate* parameter.
     */
    @JvmName("oauewacykwxmfenh")
    public suspend fun noRemoveEndDate(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.noRemoveEndDate = mapped
    }

    /**
     * @param value Used to remove an end date from a Capacity Reservation Fleet that is configured to end automatically at a specific date and time. To remove the end date from a Capacity Reservation Fleet, specify `true` for this paramater and omit the *EndDate* parameter.
     */
    @JvmName("jwhdbyyfuhghrgry")
    public suspend fun removeEndDate(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.removeEndDate = mapped
    }

    /**
     * @param value The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
     */
    @JvmName("iykmqavebnjhbiwr")
    public suspend fun tagSpecifications(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tagSpecifications = mapped
    }

    /**
     * @param argument The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
     */
    @JvmName("bsgxafrpawxxxrdk")
    public suspend fun tagSpecifications(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            CapacityReservationFleetTagSpecificationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.tagSpecifications = mapped
    }

    /**
     * @param argument The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
     */
    @JvmName("lfmvbhvlqnxeduku")
    public suspend fun tagSpecifications(vararg argument: suspend CapacityReservationFleetTagSpecificationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            CapacityReservationFleetTagSpecificationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.tagSpecifications = mapped
    }

    /**
     * @param argument The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
     */
    @JvmName("rjlcaqugutwiojvo")
    public suspend fun tagSpecifications(argument: suspend CapacityReservationFleetTagSpecificationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            CapacityReservationFleetTagSpecificationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.tagSpecifications = mapped
    }

    /**
     * @param values The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
     */
    @JvmName("lsuxuahhkhecqctw")
    public suspend fun tagSpecifications(vararg values: CapacityReservationFleetTagSpecificationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tagSpecifications = mapped
    }

    /**
     * @param value Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings:
     * - `default` - The Capacity Reservation Fleet is created on hardware that is shared with other AWS accounts .
     * - `dedicated` - The Capacity Reservations are created on single-tenant hardware that is dedicated to a single AWS account .
     */
    @JvmName("txkiiwmnssphatpm")
    public suspend fun tenancy(`value`: CapacityReservationFleetTenancy?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tenancy = mapped
    }

    /**
     * @param value The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together with the instance type weights that you assign to each instance type used by the Fleet determine the number of instances for which the Fleet reserves capacity. Both values are based on units that make sense for your workload. For more information, see [Total target capacity](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/crfleet-concepts.html#target-capacity) in the *Amazon EC2 User Guide* .
     */
    @JvmName("wwfeglwlvrcymfwh")
    public suspend fun totalTargetCapacity(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.totalTargetCapacity = mapped
    }

    internal fun build(): CapacityReservationFleetArgs = CapacityReservationFleetArgs(
        allocationStrategy = allocationStrategy,
        endDate = endDate,
        instanceMatchCriteria = instanceMatchCriteria,
        instanceTypeSpecifications = instanceTypeSpecifications,
        noRemoveEndDate = noRemoveEndDate,
        removeEndDate = removeEndDate,
        tagSpecifications = tagSpecifications,
        tenancy = tenancy,
        totalTargetCapacity = totalTargetCapacity,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy