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

com.pulumi.awsnative.ecs.kotlin.PrimaryTaskSet.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.ecs.kotlin

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

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

    public var args: PrimaryTaskSetArgs = PrimaryTaskSetArgs()

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

/**
 * A pseudo-resource that manages which of your ECS task sets is primary.
 */
public class PrimaryTaskSet internal constructor(
    override val javaResource: com.pulumi.awsnative.ecs.PrimaryTaskSet,
) : KotlinCustomResource(javaResource, PrimaryTaskSetMapper) {
    /**
     * The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in.
     */
    public val cluster: Output
        get() = javaResource.cluster().applyValue({ args0 -> args0 })

    /**
     * The short name or full Amazon Resource Name (ARN) of the service to create the task set in.
     */
    public val service: Output
        get() = javaResource.service().applyValue({ args0 -> args0 })

    /**
     * The ID or full Amazon Resource Name (ARN) of the task set.
     */
    public val taskSetId: Output
        get() = javaResource.taskSetId().applyValue({ args0 -> args0 })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy