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

com.pulumi.awsnative.eks.kotlin.FargateProfile.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.eks.kotlin

import com.pulumi.awsnative.eks.kotlin.outputs.FargateProfileSelector
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.eks.kotlin.outputs.FargateProfileSelector.Companion.toKotlin as fargateProfileSelectorToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: FargateProfileArgs = FargateProfileArgs()

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

/**
 * Resource Schema for AWS::EKS::FargateProfile
 */
public class FargateProfile internal constructor(
    override val javaResource: com.pulumi.awsnative.eks.FargateProfile,
) : KotlinCustomResource(javaResource, FargateProfileMapper) {
    /**
     * The ARN of the cluster, such as `arn:aws:eks:us-west-2:666666666666:fargateprofile/myCluster/myFargateProfile/1cb1a11a-1dc1-1d11-cf11-1111f11fa111` .
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * Name of the Cluster
     */
    public val clusterName: Output
        get() = javaResource.clusterName().applyValue({ args0 -> args0 })

    /**
     * Name of FargateProfile
     */
    public val fargateProfileName: Output?
        get() = javaResource.fargateProfileName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The IAM policy arn for pods
     */
    public val podExecutionRoleArn: Output
        get() = javaResource.podExecutionRoleArn().applyValue({ args0 -> args0 })

    /**
     * The selectors to match for a `Pod` to use this Fargate profile. Each selector must have an associated Kubernetes `namespace` . Optionally, you can also specify `labels` for a `namespace` . You may specify up to five selectors in a Fargate profile.
     */
    public val selectors: Output>
        get() = javaResource.selectors().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    fargateProfileSelectorToKotlin(args0)
                })
            })
        })

    /**
     * The IDs of subnets to launch a `Pod` into. A `Pod` running on Fargate isn't assigned a public IP address, so only private subnets (with no direct route to an Internet Gateway) are accepted for this parameter.
     */
    public val subnets: Output>?
        get() = javaResource.subnets().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * 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)
        })
}

public object FargateProfileMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.eks.FargateProfile::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy