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

com.pulumi.vault.appRole.kotlin.AuthBackendRoleArgs.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.appRole.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.vault.appRole.AuthBackendRoleArgs.builder
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages an AppRole auth backend role in a Vault server. See the [Vault
 * documentation](https://www.vaultproject.io/docs/auth/approle) for more
 * information.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const approle = new vault.AuthBackend("approle", {type: "approle"});
 * const example = new vault.approle.AuthBackendRole("example", {
 *     backend: approle.path,
 *     roleName: "test-role",
 *     tokenPolicies: [
 *         "default",
 *         "dev",
 *         "prod",
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * approle = vault.AuthBackend("approle", type="approle")
 * example = vault.app_role.AuthBackendRole("example",
 *     backend=approle.path,
 *     role_name="test-role",
 *     token_policies=[
 *         "default",
 *         "dev",
 *         "prod",
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var approle = new Vault.AuthBackend("approle", new()
 *     {
 *         Type = "approle",
 *     });
 *     var example = new Vault.AppRole.AuthBackendRole("example", new()
 *     {
 *         Backend = approle.Path,
 *         RoleName = "test-role",
 *         TokenPolicies = new[]
 *         {
 *             "default",
 *             "dev",
 *             "prod",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
 * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/appRole"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		approle, err := vault.NewAuthBackend(ctx, "approle", &vault.AuthBackendArgs{
 * 			Type: pulumi.String("approle"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appRole.NewAuthBackendRole(ctx, "example", &appRole.AuthBackendRoleArgs{
 * 			Backend:  approle.Path,
 * 			RoleName: pulumi.String("test-role"),
 * 			TokenPolicies: pulumi.StringArray{
 * 				pulumi.String("default"),
 * 				pulumi.String("dev"),
 * 				pulumi.String("prod"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.vault.AuthBackend;
 * import com.pulumi.vault.AuthBackendArgs;
 * import com.pulumi.vault.appRole.AuthBackendRole;
 * import com.pulumi.vault.appRole.AuthBackendRoleArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var approle = new AuthBackend("approle", AuthBackendArgs.builder()
 *             .type("approle")
 *             .build());
 *         var example = new AuthBackendRole("example", AuthBackendRoleArgs.builder()
 *             .backend(approle.path())
 *             .roleName("test-role")
 *             .tokenPolicies(
 *                 "default",
 *                 "dev",
 *                 "prod")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   approle:
 *     type: vault:AuthBackend
 *     properties:
 *       type: approle
 *   example:
 *     type: vault:appRole:AuthBackendRole
 *     properties:
 *       backend: ${approle.path}
 *       roleName: test-role
 *       tokenPolicies:
 *         - default
 *         - dev
 *         - prod
 * ```
 * 
 * ## Import
 * AppRole authentication backend roles can be imported using the `path`, e.g.
 * ```sh
 * $ pulumi import vault:appRole/authBackendRole:AuthBackendRole example auth/approle/role/test-role
 * ```
 * @property backend The unique name of the auth backend to configure.
 * Defaults to `approle`.
 * @property bindSecretId Whether or not to require `secret_id` to be
 * presented when logging in using this AppRole. Defaults to `true`.
 * @property namespace 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*.
 * @property roleId The RoleID of this role. If not specified, one will be
 * auto-generated.
 * @property roleName The name of the role.
 * @property secretIdBoundCidrs If set,
 * specifies blocks of IP addresses which can perform the login operation.
 * @property secretIdNumUses The number of times any particular SecretID
 * can be used to fetch a token from this AppRole, after which the SecretID will
 * expire. A value of zero will allow unlimited uses.
 * @property secretIdTtl The number of seconds after which any SecretID
 * expires.
 * @property tokenBoundCidrs Specifies the blocks of IP addresses which are allowed to use the generated token
 * @property tokenExplicitMaxTtl Generated Token's Explicit Maximum TTL in seconds
 * @property tokenMaxTtl The maximum lifetime of the generated token
 * @property tokenNoDefaultPolicy If true, the 'default' policy will not automatically be added to generated tokens
 * @property tokenNumUses The maximum number of times a token may be used, a value of zero means unlimited
 * @property tokenPeriod Generated Token's Period
 * @property tokenPolicies Generated Token's Policies
 * @property tokenTtl The initial ttl of the token to generate in seconds
 * @property tokenType The type of token to generate, service or batch
 */
public data class AuthBackendRoleArgs(
    public val backend: Output? = null,
    public val bindSecretId: Output? = null,
    public val namespace: Output? = null,
    public val roleId: Output? = null,
    public val roleName: Output? = null,
    public val secretIdBoundCidrs: Output>? = null,
    public val secretIdNumUses: Output? = null,
    public val secretIdTtl: Output? = null,
    public val tokenBoundCidrs: Output>? = null,
    public val tokenExplicitMaxTtl: Output? = null,
    public val tokenMaxTtl: Output? = null,
    public val tokenNoDefaultPolicy: Output? = null,
    public val tokenNumUses: Output? = null,
    public val tokenPeriod: Output? = null,
    public val tokenPolicies: Output>? = null,
    public val tokenTtl: Output? = null,
    public val tokenType: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.vault.appRole.AuthBackendRoleArgs =
        com.pulumi.vault.appRole.AuthBackendRoleArgs.builder()
            .backend(backend?.applyValue({ args0 -> args0 }))
            .bindSecretId(bindSecretId?.applyValue({ args0 -> args0 }))
            .namespace(namespace?.applyValue({ args0 -> args0 }))
            .roleId(roleId?.applyValue({ args0 -> args0 }))
            .roleName(roleName?.applyValue({ args0 -> args0 }))
            .secretIdBoundCidrs(secretIdBoundCidrs?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .secretIdNumUses(secretIdNumUses?.applyValue({ args0 -> args0 }))
            .secretIdTtl(secretIdTtl?.applyValue({ args0 -> args0 }))
            .tokenBoundCidrs(tokenBoundCidrs?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .tokenExplicitMaxTtl(tokenExplicitMaxTtl?.applyValue({ args0 -> args0 }))
            .tokenMaxTtl(tokenMaxTtl?.applyValue({ args0 -> args0 }))
            .tokenNoDefaultPolicy(tokenNoDefaultPolicy?.applyValue({ args0 -> args0 }))
            .tokenNumUses(tokenNumUses?.applyValue({ args0 -> args0 }))
            .tokenPeriod(tokenPeriod?.applyValue({ args0 -> args0 }))
            .tokenPolicies(tokenPolicies?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .tokenTtl(tokenTtl?.applyValue({ args0 -> args0 }))
            .tokenType(tokenType?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AuthBackendRoleArgs].
 */
@PulumiTagMarker
public class AuthBackendRoleArgsBuilder internal constructor() {
    private var backend: Output? = null

    private var bindSecretId: Output? = null

    private var namespace: Output? = null

    private var roleId: Output? = null

    private var roleName: Output? = null

    private var secretIdBoundCidrs: Output>? = null

    private var secretIdNumUses: Output? = null

    private var secretIdTtl: Output? = null

    private var tokenBoundCidrs: Output>? = null

    private var tokenExplicitMaxTtl: Output? = null

    private var tokenMaxTtl: Output? = null

    private var tokenNoDefaultPolicy: Output? = null

    private var tokenNumUses: Output? = null

    private var tokenPeriod: Output? = null

    private var tokenPolicies: Output>? = null

    private var tokenTtl: Output? = null

    private var tokenType: Output? = null

    /**
     * @param value The unique name of the auth backend to configure.
     * Defaults to `approle`.
     */
    @JvmName("pjbmsltecdeuduip")
    public suspend fun backend(`value`: Output) {
        this.backend = value
    }

    /**
     * @param value Whether or not to require `secret_id` to be
     * presented when logging in using this AppRole. Defaults to `true`.
     */
    @JvmName("gmuayttphmexhiak")
    public suspend fun bindSecretId(`value`: Output) {
        this.bindSecretId = value
    }

    /**
     * @param value 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*.
     */
    @JvmName("qmwknacpgwlhabaa")
    public suspend fun namespace(`value`: Output) {
        this.namespace = value
    }

    /**
     * @param value The RoleID of this role. If not specified, one will be
     * auto-generated.
     */
    @JvmName("cgxqyuielyctwgpd")
    public suspend fun roleId(`value`: Output) {
        this.roleId = value
    }

    /**
     * @param value The name of the role.
     */
    @JvmName("ddcnhpdekksrflcd")
    public suspend fun roleName(`value`: Output) {
        this.roleName = value
    }

    /**
     * @param value If set,
     * specifies blocks of IP addresses which can perform the login operation.
     */
    @JvmName("yewghpiijdbuapto")
    public suspend fun secretIdBoundCidrs(`value`: Output>) {
        this.secretIdBoundCidrs = value
    }

    @JvmName("gdgqdbbnwqcxcmqs")
    public suspend fun secretIdBoundCidrs(vararg values: Output) {
        this.secretIdBoundCidrs = Output.all(values.asList())
    }

    /**
     * @param values If set,
     * specifies blocks of IP addresses which can perform the login operation.
     */
    @JvmName("rlwwtxdohskoolpy")
    public suspend fun secretIdBoundCidrs(values: List>) {
        this.secretIdBoundCidrs = Output.all(values)
    }

    /**
     * @param value The number of times any particular SecretID
     * can be used to fetch a token from this AppRole, after which the SecretID will
     * expire. A value of zero will allow unlimited uses.
     */
    @JvmName("cijyoiotvfbkqdlw")
    public suspend fun secretIdNumUses(`value`: Output) {
        this.secretIdNumUses = value
    }

    /**
     * @param value The number of seconds after which any SecretID
     * expires.
     */
    @JvmName("duojqnsdkldgnibl")
    public suspend fun secretIdTtl(`value`: Output) {
        this.secretIdTtl = value
    }

    /**
     * @param value Specifies the blocks of IP addresses which are allowed to use the generated token
     */
    @JvmName("delibngvlamaunfs")
    public suspend fun tokenBoundCidrs(`value`: Output>) {
        this.tokenBoundCidrs = value
    }

    @JvmName("lcovhssvsecgqife")
    public suspend fun tokenBoundCidrs(vararg values: Output) {
        this.tokenBoundCidrs = Output.all(values.asList())
    }

    /**
     * @param values Specifies the blocks of IP addresses which are allowed to use the generated token
     */
    @JvmName("ntukfjmhnlhcmegt")
    public suspend fun tokenBoundCidrs(values: List>) {
        this.tokenBoundCidrs = Output.all(values)
    }

    /**
     * @param value Generated Token's Explicit Maximum TTL in seconds
     */
    @JvmName("ecdwgevujxdxetsu")
    public suspend fun tokenExplicitMaxTtl(`value`: Output) {
        this.tokenExplicitMaxTtl = value
    }

    /**
     * @param value The maximum lifetime of the generated token
     */
    @JvmName("ecdqobijlgqrldcw")
    public suspend fun tokenMaxTtl(`value`: Output) {
        this.tokenMaxTtl = value
    }

    /**
     * @param value If true, the 'default' policy will not automatically be added to generated tokens
     */
    @JvmName("dthsnuebqgyllfrm")
    public suspend fun tokenNoDefaultPolicy(`value`: Output) {
        this.tokenNoDefaultPolicy = value
    }

    /**
     * @param value The maximum number of times a token may be used, a value of zero means unlimited
     */
    @JvmName("dxernlmibuwbwqhn")
    public suspend fun tokenNumUses(`value`: Output) {
        this.tokenNumUses = value
    }

    /**
     * @param value Generated Token's Period
     */
    @JvmName("obxigytiikcwokcc")
    public suspend fun tokenPeriod(`value`: Output) {
        this.tokenPeriod = value
    }

    /**
     * @param value Generated Token's Policies
     */
    @JvmName("vxlnacjgeqntgihs")
    public suspend fun tokenPolicies(`value`: Output>) {
        this.tokenPolicies = value
    }

    @JvmName("pkbkfwuwfbebtmgq")
    public suspend fun tokenPolicies(vararg values: Output) {
        this.tokenPolicies = Output.all(values.asList())
    }

    /**
     * @param values Generated Token's Policies
     */
    @JvmName("gyimdeufbslasqra")
    public suspend fun tokenPolicies(values: List>) {
        this.tokenPolicies = Output.all(values)
    }

    /**
     * @param value The initial ttl of the token to generate in seconds
     */
    @JvmName("ypgmajbcaudtcnuf")
    public suspend fun tokenTtl(`value`: Output) {
        this.tokenTtl = value
    }

    /**
     * @param value The type of token to generate, service or batch
     */
    @JvmName("ekrsqebirsyhuktv")
    public suspend fun tokenType(`value`: Output) {
        this.tokenType = value
    }

    /**
     * @param value The unique name of the auth backend to configure.
     * Defaults to `approle`.
     */
    @JvmName("bsddskljikgqgppu")
    public suspend fun backend(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backend = mapped
    }

    /**
     * @param value Whether or not to require `secret_id` to be
     * presented when logging in using this AppRole. Defaults to `true`.
     */
    @JvmName("ebuaeuifpjyojhae")
    public suspend fun bindSecretId(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bindSecretId = mapped
    }

    /**
     * @param value 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*.
     */
    @JvmName("tixcrydltadabdaj")
    public suspend fun namespace(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namespace = mapped
    }

    /**
     * @param value The RoleID of this role. If not specified, one will be
     * auto-generated.
     */
    @JvmName("obbvgjhwhcwvirkf")
    public suspend fun roleId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.roleId = mapped
    }

    /**
     * @param value The name of the role.
     */
    @JvmName("vajhabbrgxnamdby")
    public suspend fun roleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.roleName = mapped
    }

    /**
     * @param value If set,
     * specifies blocks of IP addresses which can perform the login operation.
     */
    @JvmName("jftavqnxpxyaygqq")
    public suspend fun secretIdBoundCidrs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secretIdBoundCidrs = mapped
    }

    /**
     * @param values If set,
     * specifies blocks of IP addresses which can perform the login operation.
     */
    @JvmName("honbbhikindgpsme")
    public suspend fun secretIdBoundCidrs(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.secretIdBoundCidrs = mapped
    }

    /**
     * @param value The number of times any particular SecretID
     * can be used to fetch a token from this AppRole, after which the SecretID will
     * expire. A value of zero will allow unlimited uses.
     */
    @JvmName("rhtjhkrwrourmpsn")
    public suspend fun secretIdNumUses(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secretIdNumUses = mapped
    }

    /**
     * @param value The number of seconds after which any SecretID
     * expires.
     */
    @JvmName("owobdngywlwoikei")
    public suspend fun secretIdTtl(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secretIdTtl = mapped
    }

    /**
     * @param value Specifies the blocks of IP addresses which are allowed to use the generated token
     */
    @JvmName("erjtabjkwdksarbd")
    public suspend fun tokenBoundCidrs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tokenBoundCidrs = mapped
    }

    /**
     * @param values Specifies the blocks of IP addresses which are allowed to use the generated token
     */
    @JvmName("jbbcdbockfccdepd")
    public suspend fun tokenBoundCidrs(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tokenBoundCidrs = mapped
    }

    /**
     * @param value Generated Token's Explicit Maximum TTL in seconds
     */
    @JvmName("koiveyxvbwmvokps")
    public suspend fun tokenExplicitMaxTtl(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tokenExplicitMaxTtl = mapped
    }

    /**
     * @param value The maximum lifetime of the generated token
     */
    @JvmName("bahqhuwsmtqviswb")
    public suspend fun tokenMaxTtl(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tokenMaxTtl = mapped
    }

    /**
     * @param value If true, the 'default' policy will not automatically be added to generated tokens
     */
    @JvmName("wtbgqojcwmqrqutb")
    public suspend fun tokenNoDefaultPolicy(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tokenNoDefaultPolicy = mapped
    }

    /**
     * @param value The maximum number of times a token may be used, a value of zero means unlimited
     */
    @JvmName("wopiqbvllwqyawdi")
    public suspend fun tokenNumUses(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tokenNumUses = mapped
    }

    /**
     * @param value Generated Token's Period
     */
    @JvmName("ocswfayleiarykuh")
    public suspend fun tokenPeriod(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tokenPeriod = mapped
    }

    /**
     * @param value Generated Token's Policies
     */
    @JvmName("vxkxmpmvkxmcmsnf")
    public suspend fun tokenPolicies(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tokenPolicies = mapped
    }

    /**
     * @param values Generated Token's Policies
     */
    @JvmName("tnavsrrkibyjqnyd")
    public suspend fun tokenPolicies(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tokenPolicies = mapped
    }

    /**
     * @param value The initial ttl of the token to generate in seconds
     */
    @JvmName("fckofgonjwqwhbey")
    public suspend fun tokenTtl(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tokenTtl = mapped
    }

    /**
     * @param value The type of token to generate, service or batch
     */
    @JvmName("flelfkobqfqeklaq")
    public suspend fun tokenType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tokenType = mapped
    }

    internal fun build(): AuthBackendRoleArgs = AuthBackendRoleArgs(
        backend = backend,
        bindSecretId = bindSecretId,
        namespace = namespace,
        roleId = roleId,
        roleName = roleName,
        secretIdBoundCidrs = secretIdBoundCidrs,
        secretIdNumUses = secretIdNumUses,
        secretIdTtl = secretIdTtl,
        tokenBoundCidrs = tokenBoundCidrs,
        tokenExplicitMaxTtl = tokenExplicitMaxTtl,
        tokenMaxTtl = tokenMaxTtl,
        tokenNoDefaultPolicy = tokenNoDefaultPolicy,
        tokenNumUses = tokenNumUses,
        tokenPeriod = tokenPeriod,
        tokenPolicies = tokenPolicies,
        tokenTtl = tokenTtl,
        tokenType = tokenType,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy