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

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

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.awsnative.ec2.CapacityReservationArgs.builder
import com.pulumi.awsnative.ec2.kotlin.inputs.CapacityReservationTagSpecificationArgs
import com.pulumi.awsnative.ec2.kotlin.inputs.CapacityReservationTagSpecificationArgsBuilder
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::CapacityReservation
 * @property availabilityZone The Availability Zone in which to create the Capacity Reservation.
 * @property ebsOptimized Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
 * @property endDate The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to `expired` when it reaches its end date and time.
 * You must provide an `EndDate` value if `EndDateType` is `limited` . Omit `EndDate` if `EndDateType` is `unlimited` .
 * If the `EndDateType` is `limited` , the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.
 * @property endDateType Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:
 * - `unlimited` - The Capacity Reservation remains active until you explicitly cancel it. Do not provide an `EndDate` if the `EndDateType` is `unlimited` .
 * - `limited` - The Capacity Reservation expires automatically at a specified date and time. You must provide an `EndDate` value if the `EndDateType` value is `limited` .
 * @property ephemeralStorage *Deprecated.*
 * @property instanceCount The number of instances for which to reserve capacity.
 * Valid range: 1 - 1000
 * @property instanceMatchCriteria Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
 * - `open` - The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters.
 * - `targeted` - The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.
 * Default: `open`
 * @property instancePlatform The type of operating system for which to reserve capacity.
 * @property instanceType The instance type for which to reserve capacity. For more information, see [Instance types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon EC2 User Guide* .
 * @property outPostArn The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
 * @property placementGroupArn The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For more information, see [Capacity Reservations for cluster placement groups](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-cpg.html) in the *Amazon EC2 User Guide* .
 * @property tagSpecifications The tags to apply to the Capacity Reservation during launch.
 * @property tenancy Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:
 * - `default` - The Capacity Reservation is created on hardware that is shared with other AWS accounts .
 * - `dedicated` - The Capacity Reservation is created on single-tenant hardware that is dedicated to a single AWS account .
 */
public data class CapacityReservationArgs(
    public val availabilityZone: Output? = null,
    public val ebsOptimized: Output? = null,
    public val endDate: Output? = null,
    public val endDateType: Output? = null,
    public val ephemeralStorage: Output? = null,
    public val instanceCount: Output? = null,
    public val instanceMatchCriteria: Output? = null,
    public val instancePlatform: Output? = null,
    public val instanceType: Output? = null,
    public val outPostArn: Output? = null,
    public val placementGroupArn: Output? = null,
    public val tagSpecifications: Output>? = null,
    public val tenancy: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ec2.CapacityReservationArgs =
        com.pulumi.awsnative.ec2.CapacityReservationArgs.builder()
            .availabilityZone(availabilityZone?.applyValue({ args0 -> args0 }))
            .ebsOptimized(ebsOptimized?.applyValue({ args0 -> args0 }))
            .endDate(endDate?.applyValue({ args0 -> args0 }))
            .endDateType(endDateType?.applyValue({ args0 -> args0 }))
            .ephemeralStorage(ephemeralStorage?.applyValue({ args0 -> args0 }))
            .instanceCount(instanceCount?.applyValue({ args0 -> args0 }))
            .instanceMatchCriteria(instanceMatchCriteria?.applyValue({ args0 -> args0 }))
            .instancePlatform(instancePlatform?.applyValue({ args0 -> args0 }))
            .instanceType(instanceType?.applyValue({ args0 -> args0 }))
            .outPostArn(outPostArn?.applyValue({ args0 -> args0 }))
            .placementGroupArn(placementGroupArn?.applyValue({ args0 -> args0 }))
            .tagSpecifications(
                tagSpecifications?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .tenancy(tenancy?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [CapacityReservationArgs].
 */
@PulumiTagMarker
public class CapacityReservationArgsBuilder internal constructor() {
    private var availabilityZone: Output? = null

    private var ebsOptimized: Output? = null

    private var endDate: Output? = null

    private var endDateType: Output? = null

    private var ephemeralStorage: Output? = null

    private var instanceCount: Output? = null

    private var instanceMatchCriteria: Output? = null

    private var instancePlatform: Output? = null

    private var instanceType: Output? = null

    private var outPostArn: Output? = null

    private var placementGroupArn: Output? = null

    private var tagSpecifications: Output>? = null

    private var tenancy: Output? = null

    /**
     * @param value The Availability Zone in which to create the Capacity Reservation.
     */
    @JvmName("nagpmtrnwunpuhdo")
    public suspend fun availabilityZone(`value`: Output) {
        this.availabilityZone = value
    }

    /**
     * @param value Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
     */
    @JvmName("toibbnninfuusbjt")
    public suspend fun ebsOptimized(`value`: Output) {
        this.ebsOptimized = value
    }

    /**
     * @param value The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to `expired` when it reaches its end date and time.
     * You must provide an `EndDate` value if `EndDateType` is `limited` . Omit `EndDate` if `EndDateType` is `unlimited` .
     * If the `EndDateType` is `limited` , the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.
     */
    @JvmName("sdpmdnharqnepmxn")
    public suspend fun endDate(`value`: Output) {
        this.endDate = value
    }

    /**
     * @param value Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:
     * - `unlimited` - The Capacity Reservation remains active until you explicitly cancel it. Do not provide an `EndDate` if the `EndDateType` is `unlimited` .
     * - `limited` - The Capacity Reservation expires automatically at a specified date and time. You must provide an `EndDate` value if the `EndDateType` value is `limited` .
     */
    @JvmName("ttrfjwkdxskeuduh")
    public suspend fun endDateType(`value`: Output) {
        this.endDateType = value
    }

    /**
     * @param value *Deprecated.*
     */
    @JvmName("johxhjqudqfksfqc")
    public suspend fun ephemeralStorage(`value`: Output) {
        this.ephemeralStorage = value
    }

    /**
     * @param value The number of instances for which to reserve capacity.
     * Valid range: 1 - 1000
     */
    @JvmName("ksfvatminlvlhybn")
    public suspend fun instanceCount(`value`: Output) {
        this.instanceCount = value
    }

    /**
     * @param value Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
     * - `open` - The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters.
     * - `targeted` - The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.
     * Default: `open`
     */
    @JvmName("beqwtccmqcsdebny")
    public suspend fun instanceMatchCriteria(`value`: Output) {
        this.instanceMatchCriteria = value
    }

    /**
     * @param value The type of operating system for which to reserve capacity.
     */
    @JvmName("bqllknbntssbqgjt")
    public suspend fun instancePlatform(`value`: Output) {
        this.instancePlatform = value
    }

    /**
     * @param value The instance type for which to reserve capacity. For more information, see [Instance types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon EC2 User Guide* .
     */
    @JvmName("qhubxnuqppikrrne")
    public suspend fun instanceType(`value`: Output) {
        this.instanceType = value
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
     */
    @JvmName("silthlwllmkihpax")
    public suspend fun outPostArn(`value`: Output) {
        this.outPostArn = value
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For more information, see [Capacity Reservations for cluster placement groups](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-cpg.html) in the *Amazon EC2 User Guide* .
     */
    @JvmName("jdekxfcnbcsbecqp")
    public suspend fun placementGroupArn(`value`: Output) {
        this.placementGroupArn = value
    }

    /**
     * @param value The tags to apply to the Capacity Reservation during launch.
     */
    @JvmName("kqajrgbligcdjfsa")
    public suspend fun tagSpecifications(`value`: Output>) {
        this.tagSpecifications = value
    }

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

    /**
     * @param values The tags to apply to the Capacity Reservation during launch.
     */
    @JvmName("byunkgjunkqlhksr")
    public suspend fun tagSpecifications(values: List>) {
        this.tagSpecifications = Output.all(values)
    }

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

    /**
     * @param value The Availability Zone in which to create the Capacity Reservation.
     */
    @JvmName("mdmtyubsqsoyfesx")
    public suspend fun availabilityZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.availabilityZone = mapped
    }

    /**
     * @param value Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
     */
    @JvmName("wlugoyhonidphctd")
    public suspend fun ebsOptimized(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ebsOptimized = mapped
    }

    /**
     * @param value The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to `expired` when it reaches its end date and time.
     * You must provide an `EndDate` value if `EndDateType` is `limited` . Omit `EndDate` if `EndDateType` is `unlimited` .
     * If the `EndDateType` is `limited` , the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.
     */
    @JvmName("syuuihemjwxnbslr")
    public suspend fun endDate(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.endDate = mapped
    }

    /**
     * @param value Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:
     * - `unlimited` - The Capacity Reservation remains active until you explicitly cancel it. Do not provide an `EndDate` if the `EndDateType` is `unlimited` .
     * - `limited` - The Capacity Reservation expires automatically at a specified date and time. You must provide an `EndDate` value if the `EndDateType` value is `limited` .
     */
    @JvmName("cxbvnhntnjlurkgo")
    public suspend fun endDateType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.endDateType = mapped
    }

    /**
     * @param value *Deprecated.*
     */
    @JvmName("mrtbbgepsyqlukoi")
    public suspend fun ephemeralStorage(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ephemeralStorage = mapped
    }

    /**
     * @param value The number of instances for which to reserve capacity.
     * Valid range: 1 - 1000
     */
    @JvmName("opwfneqbosbvtbny")
    public suspend fun instanceCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceCount = mapped
    }

    /**
     * @param value Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
     * - `open` - The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters.
     * - `targeted` - The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.
     * Default: `open`
     */
    @JvmName("dnvdodpbkadhenfx")
    public suspend fun instanceMatchCriteria(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceMatchCriteria = mapped
    }

    /**
     * @param value The type of operating system for which to reserve capacity.
     */
    @JvmName("lpmqvnkrrkwilnly")
    public suspend fun instancePlatform(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instancePlatform = mapped
    }

    /**
     * @param value The instance type for which to reserve capacity. For more information, see [Instance types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon EC2 User Guide* .
     */
    @JvmName("rcabtbbtbywelpus")
    public suspend fun instanceType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceType = mapped
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
     */
    @JvmName("bjicjuujdskuosex")
    public suspend fun outPostArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.outPostArn = mapped
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For more information, see [Capacity Reservations for cluster placement groups](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-cpg.html) in the *Amazon EC2 User Guide* .
     */
    @JvmName("yjilppgaqprppyxd")
    public suspend fun placementGroupArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.placementGroupArn = mapped
    }

    /**
     * @param value The tags to apply to the Capacity Reservation during launch.
     */
    @JvmName("khbetjjtklvdisio")
    public suspend fun tagSpecifications(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tagSpecifications = mapped
    }

    /**
     * @param argument The tags to apply to the Capacity Reservation during launch.
     */
    @JvmName("pumgeookwvyxdcjn")
    public suspend fun tagSpecifications(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            CapacityReservationTagSpecificationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.tagSpecifications = mapped
    }

    /**
     * @param argument The tags to apply to the Capacity Reservation during launch.
     */
    @JvmName("jeutxrwawvnkoyco")
    public suspend fun tagSpecifications(vararg argument: suspend CapacityReservationTagSpecificationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            CapacityReservationTagSpecificationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.tagSpecifications = mapped
    }

    /**
     * @param argument The tags to apply to the Capacity Reservation during launch.
     */
    @JvmName("yeockhtypcjjisex")
    public suspend fun tagSpecifications(argument: suspend CapacityReservationTagSpecificationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            CapacityReservationTagSpecificationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.tagSpecifications = mapped
    }

    /**
     * @param values The tags to apply to the Capacity Reservation during launch.
     */
    @JvmName("oetpunrriowgnsyb")
    public suspend fun tagSpecifications(vararg values: CapacityReservationTagSpecificationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tagSpecifications = mapped
    }

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

    internal fun build(): CapacityReservationArgs = CapacityReservationArgs(
        availabilityZone = availabilityZone,
        ebsOptimized = ebsOptimized,
        endDate = endDate,
        endDateType = endDateType,
        ephemeralStorage = ephemeralStorage,
        instanceCount = instanceCount,
        instanceMatchCriteria = instanceMatchCriteria,
        instancePlatform = instancePlatform,
        instanceType = instanceType,
        outPostArn = outPostArn,
        placementGroupArn = placementGroupArn,
        tagSpecifications = tagSpecifications,
        tenancy = tenancy,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy