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

com.pulumi.vault.kotlin.AuthBackend.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: 6.4.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.vault.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 com.pulumi.vault.kotlin.outputs.AuthBackendTune
import com.pulumi.vault.kotlin.outputs.AuthBackendTune.Companion.toKotlin
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: AuthBackendArgs = AuthBackendArgs()

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

/**
 *
 * ## Import
 * Auth methods can be imported using the `path`, e.g.
 * ```sh
 * $ pulumi import vault:index/authBackend:AuthBackend example github
 * ```
 */
public class AuthBackend internal constructor(
    override val javaResource: com.pulumi.vault.AuthBackend,
) : KotlinCustomResource(javaResource, AuthBackendMapper) {
    /**
     * The accessor for this auth method
     */
    public val accessor: Output
        get() = javaResource.accessor().applyValue({ args0 -> args0 })

    /**
     * A description of the auth method.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * If set, opts out of mount migration on path updates.
     * See here for more info on [Mount Migration](https://www.vaultproject.io/docs/concepts/mount-migration)
     */
    public val disableRemount: Output?
        get() = javaResource.disableRemount().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The key to use for signing identity tokens.
     */
    public val identityTokenKey: Output?
        get() = javaResource.identityTokenKey().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies if the auth method is local only.
     */
    public val local: Output?
        get() = javaResource.local().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The namespace to provision the resource in.
     * The value should not contain leading or trailing forward slashes.
     * The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
     * *Available only for Vault Enterprise*.
     */
    public val namespace: Output?
        get() = javaResource.namespace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The path to mount the auth method — this defaults to the name of the type.
     */
    public val path: Output
        get() = javaResource.path().applyValue({ args0 -> args0 })

    /**
     * Extra configuration block. Structure is documented below.
     * The `tune` block is used to tune the auth backend:
     */
    public val tune: Output
        get() = javaResource.tune().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })

    /**
     * The name of the auth method type.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

public object AuthBackendMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.vault.AuthBackend::class == javaResource::class

    override fun map(javaResource: Resource): AuthBackend = AuthBackend(
        javaResource as
            com.pulumi.vault.AuthBackend,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy