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

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

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

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.awsnative.ec2.kotlin.enums.CapacityReservationFleetInstanceMatchCriteria
import com.pulumi.awsnative.ec2.kotlin.enums.CapacityReservationFleetTenancy
import com.pulumi.awsnative.ec2.kotlin.outputs.CapacityReservationFleetInstanceTypeSpecification
import com.pulumi.awsnative.ec2.kotlin.outputs.CapacityReservationFleetTagSpecification
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.ec2.kotlin.enums.CapacityReservationFleetInstanceMatchCriteria.Companion.toKotlin as capacityReservationFleetInstanceMatchCriteriaToKotlin
import com.pulumi.awsnative.ec2.kotlin.enums.CapacityReservationFleetTenancy.Companion.toKotlin as capacityReservationFleetTenancyToKotlin
import com.pulumi.awsnative.ec2.kotlin.outputs.CapacityReservationFleetInstanceTypeSpecification.Companion.toKotlin as capacityReservationFleetInstanceTypeSpecificationToKotlin
import com.pulumi.awsnative.ec2.kotlin.outputs.CapacityReservationFleetTagSpecification.Companion.toKotlin as capacityReservationFleetTagSpecificationToKotlin

/**
 * Builder for [CapacityReservationFleet].
 */
@PulumiTagMarker
public class CapacityReservationFleetResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: CapacityReservationFleetArgs = CapacityReservationFleetArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend CapacityReservationFleetArgsBuilder.() -> Unit) {
        val builder = CapacityReservationFleetArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): CapacityReservationFleet {
        val builtJavaResource =
            com.pulumi.awsnative.ec2.CapacityReservationFleet(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return CapacityReservationFleet(builtJavaResource)
    }
}

/**
 * Resource Type definition for AWS::EC2::CapacityReservationFleet
 * ## Example Usage
 * ### Example
 * No Java example available.
 */
public class CapacityReservationFleet internal constructor(
    override val javaResource: com.pulumi.awsnative.ec2.CapacityReservationFleet,
) : KotlinCustomResource(javaResource, CapacityReservationFleetMapper) {
    /**
     * 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`
     */
    public val allocationStrategy: Output?
        get() = javaResource.allocationStrategy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of the Capacity Reservation Fleet.
     */
    public val capacityReservationFleetId: Output
        get() = javaResource.capacityReservationFleetId().applyValue({ args0 -> args0 })

    /**
     * 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` .
     */
    public val endDate: Output?
        get() = javaResource.endDate().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * 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.
     */
    public val instanceMatchCriteria: Output?
        get() = javaResource.instanceMatchCriteria().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    capacityReservationFleetInstanceMatchCriteriaToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Information about the instance types for which to reserve the capacity.
     */
    public val instanceTypeSpecifications:
        Output>?
        get() = javaResource.instanceTypeSpecifications().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        capacityReservationFleetInstanceTypeSpecificationToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * 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.
     */
    public val noRemoveEndDate: Output?
        get() = javaResource.noRemoveEndDate().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * 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.
     */
    public val removeEndDate: Output?
        get() = javaResource.removeEndDate().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
     */
    public val tagSpecifications: Output>?
        get() = javaResource.tagSpecifications().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        capacityReservationFleetTagSpecificationToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * 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 .
     */
    public val tenancy: Output?
        get() = javaResource.tenancy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    capacityReservationFleetTenancyToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * 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 val totalTargetCapacity: Output?
        get() = javaResource.totalTargetCapacity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object CapacityReservationFleetMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.ec2.CapacityReservationFleet::class == javaResource::class

    override fun map(javaResource: Resource): CapacityReservationFleet =
        CapacityReservationFleet(javaResource as com.pulumi.awsnative.ec2.CapacityReservationFleet)
}

/**
 * @see [CapacityReservationFleet].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [CapacityReservationFleet].
 */
public suspend fun capacityReservationFleet(
    name: String,
    block: suspend CapacityReservationFleetResourceBuilder.() -> Unit,
): CapacityReservationFleet {
    val builder = CapacityReservationFleetResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [CapacityReservationFleet].
 * @param name The _unique_ name of the resulting resource.
 */
public fun capacityReservationFleet(name: String): CapacityReservationFleet {
    val builder = CapacityReservationFleetResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy