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

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

package com.pulumi.vault.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinProviderResource
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.Provider
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: ProviderArgs = ProviderArgs()

    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 ProviderArgsBuilder.() -> Unit) {
        val builder = ProviderArgsBuilder()
        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(): VaultProvider {
        val builtJavaResource = Provider(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return VaultProvider(builtJavaResource)
    }
}

/**
 * The provider type for the vault package. By default, resources use package-wide configuration
 * settings, however an explicit `Provider` instance may be created and passed during resource
 * construction to achieve fine-grained programmatic control over provider settings. See the
 * [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
 */
public class VaultProvider internal constructor(
    override val javaResource: Provider,
) : KotlinProviderResource(javaResource, VaultProviderMapper) {
    public val addAddressToEnv: Output?
        get() = javaResource.addAddressToEnv().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * URL of the root of the target Vault server.
     */
    public val address: Output
        get() = javaResource.address().applyValue({ args0 -> args0 })

    /**
     * Path to directory containing CA certificate files to validate the server's certificate.
     */
    public val caCertDir: Output?
        get() = javaResource.caCertDir().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Path to a CA certificate file to validate the server's certificate.
     */
    public val caCertFile: Output?
        get() = javaResource.caCertFile().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The namespace to use. Available only for Vault Enterprise.
     */
    public val namespace: Output?
        get() = javaResource.namespace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Name to use as the SNI host when connecting via TLS.
     */
    public val tlsServerName: Output?
        get() = javaResource.tlsServerName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Token to use to authenticate to Vault.
     */
    public val token: Output
        get() = javaResource.token().applyValue({ args0 -> args0 })

    /**
     * Token name to use for creating the Vault child token.
     */
    public val tokenName: Output?
        get() = javaResource.tokenName().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Override the Vault server version, which is normally determined dynamically from the target Vault server
     */
    public val vaultVersionOverride: Output?
        get() = javaResource.vaultVersionOverride().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object VaultProviderMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        Provider::class == javaResource::class

    override fun map(javaResource: Resource): VaultProvider = VaultProvider(javaResource as Provider)
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy