com.pulumi.vault.appRole.kotlin.AuthBackendRoleArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-vault-kotlin Show documentation
Show all versions of pulumi-vault-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy