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

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

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

package com.pulumi.awsnative.eks.kotlin

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

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

    public var args: AccessEntryArgs = AccessEntryArgs()

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

/**
 * An object representing an Amazon EKS AccessEntry.
 */
public class AccessEntry internal constructor(
    override val javaResource: com.pulumi.awsnative.eks.AccessEntry,
) : KotlinCustomResource(javaResource, AccessEntryMapper) {
    /**
     * The ARN of the access entry.
     */
    public val accessEntryArn: Output
        get() = javaResource.accessEntryArn().applyValue({ args0 -> args0 })

    /**
     * An array of access policies that are associated with the access entry.
     */
    public val accessPolicies: Output>?
        get() = javaResource.accessPolicies().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        accessEntryAccessPolicyToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * The cluster that the access entry is created for.
     */
    public val clusterName: Output
        get() = javaResource.clusterName().applyValue({ args0 -> args0 })

    /**
     * The Kubernetes groups that the access entry is associated with.
     */
    public val kubernetesGroups: Output>?
        get() = javaResource.kubernetesGroups().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The principal ARN that the access entry is created for.
     */
    public val principalArn: Output
        get() = javaResource.principalArn().applyValue({ args0 -> 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 node type to associate with the access entry.
     */
    public val type: Output?
        get() = javaResource.type().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The Kubernetes user that the access entry is associated with.
     */
    public val username: Output?
        get() = javaResource.username().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy