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

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

import com.pulumi.awsnative.ecs.kotlin.enums.ClusterCapacityProviderAssociationsCapacityProvider
import com.pulumi.awsnative.ecs.kotlin.outputs.ClusterCapacityProviderAssociationsCapacityProviderStrategy
import com.pulumi.awsnative.ecs.kotlin.outputs.ClusterCapacityProviderAssociationsCapacityProviderStrategy.Companion.toKotlin
import com.pulumi.core.Either
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

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

    public var args: ClusterCapacityProviderAssociationsArgs =
        ClusterCapacityProviderAssociationsArgs()

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

/**
 * Associate a set of ECS Capacity Providers with a specified ECS Cluster
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class ClusterCapacityProviderAssociations internal constructor(
    override val javaResource: com.pulumi.awsnative.ecs.ClusterCapacityProviderAssociations,
) : KotlinCustomResource(javaResource, ClusterCapacityProviderAssociationsMapper) {
    /**
     * The capacity providers to associate with the cluster.
     */
    public val capacityProviders:
        Output>>
        get() = javaResource.capacityProviders().applyValue({ args0 ->
            args0.map({ args0 ->
                Either.ofRight(args0)
            })
        })

    /**
     * The cluster the capacity provider association is the target of.
     */
    public val cluster: Output
        get() = javaResource.cluster().applyValue({ args0 -> args0 })

    /**
     * The default capacity provider strategy to associate with the cluster.
     */
    public val defaultCapacityProviderStrategy:
        Output>
        get() = javaResource.defaultCapacityProviderStrategy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> toKotlin(args0) })
            })
        })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy