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

com.pulumi.awsnative.athena.kotlin.CapacityReservation.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.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.athena.kotlin

import com.pulumi.awsnative.athena.kotlin.enums.CapacityReservationStatus
import com.pulumi.awsnative.athena.kotlin.outputs.CapacityReservationCapacityAssignmentConfiguration
import com.pulumi.awsnative.kotlin.outputs.Tag
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.athena.kotlin.enums.CapacityReservationStatus.Companion.toKotlin as capacityReservationStatusToKotlin
import com.pulumi.awsnative.athena.kotlin.outputs.CapacityReservationCapacityAssignmentConfiguration.Companion.toKotlin as capacityReservationCapacityAssignmentConfigurationToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: CapacityReservationArgs = CapacityReservationArgs()

    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 CapacityReservationArgsBuilder.() -> Unit) {
        val builder = CapacityReservationArgsBuilder()
        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(): CapacityReservation {
        val builtJavaResource = com.pulumi.awsnative.athena.CapacityReservation(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return CapacityReservation(builtJavaResource)
    }
}

/**
 * Resource schema for AWS::Athena::CapacityReservation
 */
public class CapacityReservation internal constructor(
    override val javaResource: com.pulumi.awsnative.athena.CapacityReservation,
) : KotlinCustomResource(javaResource, CapacityReservationMapper) {
    /**
     * The number of DPUs Athena has provisioned and allocated for the reservation
     */
    public val allocatedDpus: Output
        get() = javaResource.allocatedDpus().applyValue({ args0 -> args0 })

    /**
     * The ARN of the capacity reservation.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * Assigns Athena workgroups (and hence their queries) to capacity reservations. A capacity reservation can have only one capacity assignment configuration, but the capacity assignment configuration can be made up of multiple individual assignments. Each assignment specifies how Athena queries can consume capacity from the capacity reservation that their workgroup is mapped to.
     */
    public val capacityAssignmentConfiguration:
        Output?
        get() = javaResource.capacityAssignmentConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    capacityReservationCapacityAssignmentConfigurationToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The date and time the reservation was created.
     */
    public val creationTime: Output
        get() = javaResource.creationTime().applyValue({ args0 -> args0 })

    /**
     * The timestamp when the last successful allocated was made
     */
    public val lastSuccessfulAllocationTime: Output
        get() = javaResource.lastSuccessfulAllocationTime().applyValue({ args0 -> args0 })

    /**
     * The reservation name.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The status of the reservation.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 ->
            args0.let({ args0 ->
                capacityReservationStatusToKotlin(args0)
            })
        })

    /**
     * An array of key-value pairs to apply to this resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The number of DPUs to request to be allocated to the reservation.
     */
    public val targetDpus: Output
        get() = javaResource.targetDpus().applyValue({ args0 -> args0 })
}

public object CapacityReservationMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.athena.CapacityReservation::class == javaResource::class

    override fun map(javaResource: Resource): CapacityReservation = CapacityReservation(
        javaResource
            as com.pulumi.awsnative.athena.CapacityReservation,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy