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

com.pulumi.awsnative.ecs.kotlin.CapacityProvider.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.ecs.kotlin

import com.pulumi.awsnative.ecs.kotlin.outputs.CapacityProviderAutoScalingGroupProvider
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.ecs.kotlin.outputs.CapacityProviderAutoScalingGroupProvider.Companion.toKotlin as capacityProviderAutoScalingGroupProviderToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: CapacityProviderArgs = CapacityProviderArgs()

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

/**
 * Resource Type definition for AWS::ECS::CapacityProvider.
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class CapacityProvider internal constructor(
    override val javaResource: com.pulumi.awsnative.ecs.CapacityProvider,
) : KotlinCustomResource(javaResource, CapacityProviderMapper) {
    /**
     * The Auto Scaling group settings for the capacity provider.
     */
    public val autoScalingGroupProvider: Output
        get() = javaResource.autoScalingGroupProvider().applyValue({ args0 ->
            args0.let({ args0 ->
                capacityProviderAutoScalingGroupProviderToKotlin(args0)
            })
        })

    /**
     * The name of the capacity provider. If a name is specified, it cannot start with `aws` , `ecs` , or `fargate` . If no name is specified, a default name in the `CFNStackName-CFNResourceName-RandomString` format is used.
     */
    public val name: Output?
        get() = javaResource.name().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The metadata that you apply to the capacity provider to help you categorize and organize it. Each tag consists of a key and an optional value. You define both.
     * The following basic restrictions apply to tags:
     * - Maximum number of tags per resource - 50
     * - For each resource, each tag key must be unique, and each tag key can have only one value.
     * - Maximum key length - 128 Unicode characters in UTF-8
     * - Maximum value length - 256 Unicode characters in UTF-8
     * - If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
     * - Tag keys and values are case-sensitive.
     * - Do not use `aws:` , `AWS:` , or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for AWS use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object CapacityProviderMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.ecs.CapacityProvider::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy