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

com.pulumi.awsnative.ec2.kotlin.inputs.LaunchTemplateCapacityReservationSpecificationArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.ec2.kotlin.inputs

import com.pulumi.awsnative.ec2.inputs.LaunchTemplateCapacityReservationSpecificationArgs.builder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * Specifies an instance's Capacity Reservation targeting option. You can specify only one option at a time.
 *   ``CapacityReservationSpecification`` is a property of [AWS::EC2::LaunchTemplate LaunchTemplateData](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html).
 * @property capacityReservationPreference Indicates the instance's Capacity Reservation preferences. Possible preferences include:
 *   +   ``open`` - The instance can run in any ``open`` Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
 *   +   ``none`` - The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.
 * @property capacityReservationTarget Information about the target Capacity Reservation or Capacity Reservation group.
 */
public data class LaunchTemplateCapacityReservationSpecificationArgs(
    public val capacityReservationPreference: Output? = null,
    public val capacityReservationTarget: Output? = null,
) :
    ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ec2.inputs.LaunchTemplateCapacityReservationSpecificationArgs =
        com.pulumi.awsnative.ec2.inputs.LaunchTemplateCapacityReservationSpecificationArgs.builder()
            .capacityReservationPreference(capacityReservationPreference?.applyValue({ args0 -> args0 }))
            .capacityReservationTarget(
                capacityReservationTarget?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [LaunchTemplateCapacityReservationSpecificationArgs].
 */
@PulumiTagMarker
public class LaunchTemplateCapacityReservationSpecificationArgsBuilder internal constructor() {
    private var capacityReservationPreference: Output? = null

    private var capacityReservationTarget: Output? = null

    /**
     * @param value Indicates the instance's Capacity Reservation preferences. Possible preferences include:
     *   +   ``open`` - The instance can run in any ``open`` Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
     *   +   ``none`` - The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.
     */
    @JvmName("rotfxcpulpvircjp")
    public suspend fun capacityReservationPreference(`value`: Output) {
        this.capacityReservationPreference = value
    }

    /**
     * @param value Information about the target Capacity Reservation or Capacity Reservation group.
     */
    @JvmName("cmdoirydwhvgcknh")
    public suspend fun capacityReservationTarget(`value`: Output) {
        this.capacityReservationTarget = value
    }

    /**
     * @param value Indicates the instance's Capacity Reservation preferences. Possible preferences include:
     *   +   ``open`` - The instance can run in any ``open`` Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
     *   +   ``none`` - The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.
     */
    @JvmName("hmnenedecgjfphva")
    public suspend fun capacityReservationPreference(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.capacityReservationPreference = mapped
    }

    /**
     * @param value Information about the target Capacity Reservation or Capacity Reservation group.
     */
    @JvmName("qvuswfwcdqxnktlj")
    public suspend fun capacityReservationTarget(`value`: LaunchTemplateCapacityReservationTargetArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.capacityReservationTarget = mapped
    }

    /**
     * @param argument Information about the target Capacity Reservation or Capacity Reservation group.
     */
    @JvmName("jmycwswimtujsqum")
    public suspend fun capacityReservationTarget(argument: suspend LaunchTemplateCapacityReservationTargetArgsBuilder.() -> Unit) {
        val toBeMapped = LaunchTemplateCapacityReservationTargetArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.capacityReservationTarget = mapped
    }

    internal fun build(): LaunchTemplateCapacityReservationSpecificationArgs =
        LaunchTemplateCapacityReservationSpecificationArgs(
            capacityReservationPreference = capacityReservationPreference,
            capacityReservationTarget = capacityReservationTarget,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy