Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
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.tokenauth.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.tokenauth.AuthBackendRoleArgs.builder
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Manages Token auth backend role in a Vault server. See the [Vault
* documentation](https://www.vaultproject.io/docs/auth/token.html) for more
* information.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const example = new vault.tokenauth.AuthBackendRole("example", {
* roleName: "my-role",
* allowedPolicies: [
* "dev",
* "test",
* ],
* disallowedPolicies: ["default"],
* allowedEntityAliases: ["test_entity"],
* orphan: true,
* tokenPeriod: 86400,
* renewable: true,
* tokenExplicitMaxTtl: 115200,
* pathSuffix: "path-suffix",
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* example = vault.tokenauth.AuthBackendRole("example",
* role_name="my-role",
* allowed_policies=[
* "dev",
* "test",
* ],
* disallowed_policies=["default"],
* allowed_entity_aliases=["test_entity"],
* orphan=True,
* token_period=86400,
* renewable=True,
* token_explicit_max_ttl=115200,
* path_suffix="path-suffix")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var example = new Vault.TokenAuth.AuthBackendRole("example", new()
* {
* RoleName = "my-role",
* AllowedPolicies = new[]
* {
* "dev",
* "test",
* },
* DisallowedPolicies = new[]
* {
* "default",
* },
* AllowedEntityAliases = new[]
* {
* "test_entity",
* },
* Orphan = true,
* TokenPeriod = 86400,
* Renewable = true,
* TokenExplicitMaxTtl = 115200,
* PathSuffix = "path-suffix",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/tokenauth"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := tokenauth.NewAuthBackendRole(ctx, "example", &tokenauth.AuthBackendRoleArgs{
* RoleName: pulumi.String("my-role"),
* AllowedPolicies: pulumi.StringArray{
* pulumi.String("dev"),
* pulumi.String("test"),
* },
* DisallowedPolicies: pulumi.StringArray{
* pulumi.String("default"),
* },
* AllowedEntityAliases: pulumi.StringArray{
* pulumi.String("test_entity"),
* },
* Orphan: pulumi.Bool(true),
* TokenPeriod: pulumi.Int(86400),
* Renewable: pulumi.Bool(true),
* TokenExplicitMaxTtl: pulumi.Int(115200),
* PathSuffix: pulumi.String("path-suffix"),
* })
* 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.tokenauth.AuthBackendRole;
* import com.pulumi.vault.tokenauth.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 example = new AuthBackendRole("example", AuthBackendRoleArgs.builder()
* .roleName("my-role")
* .allowedPolicies(
* "dev",
* "test")
* .disallowedPolicies("default")
* .allowedEntityAliases("test_entity")
* .orphan(true)
* .tokenPeriod("86400")
* .renewable(true)
* .tokenExplicitMaxTtl("115200")
* .pathSuffix("path-suffix")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: vault:tokenauth:AuthBackendRole
* properties:
* roleName: my-role
* allowedPolicies:
* - dev
* - test
* disallowedPolicies:
* - default
* allowedEntityAliases:
* - test_entity
* orphan: true
* tokenPeriod: '86400'
* renewable: true
* tokenExplicitMaxTtl: '115200'
* pathSuffix: path-suffix
* ```
*
* ## Import
* Token auth backend roles can be imported with `auth/token/roles/` followed by the `role_name`, e.g.
* ```sh
* $ pulumi import vault:tokenauth/authBackendRole:AuthBackendRole example auth/token/roles/my-role
* ```
* @property allowedEntityAliases List of allowed entity aliases.
* @property allowedPolicies List of allowed policies for given role.
* @property allowedPoliciesGlobs Set of allowed policies with glob match for given role.
* @property disallowedPolicies List of disallowed policies for given role.
* @property disallowedPoliciesGlobs Set of disallowed policies with glob match for given role.
* @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 orphan If true, tokens created against this policy will be orphan tokens.
* @property pathSuffix Tokens created against this role will have the given suffix as part of their path in addition to the role name.
* > Due to a bug the resource. This *will* cause all existing tokens issued by this role to be revoked.
* @property renewable Whether to disable the ability of the token to be renewed past its initial TTL.
* @property roleName The name of the role.
* @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 allowedEntityAliases: Output>? = null,
public val allowedPolicies: Output>? = null,
public val allowedPoliciesGlobs: Output>? = null,
public val disallowedPolicies: Output>? = null,
public val disallowedPoliciesGlobs: Output>? = null,
public val namespace: Output? = null,
public val orphan: Output? = null,
public val pathSuffix: Output? = null,
public val renewable: Output? = null,
public val roleName: 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.tokenauth.AuthBackendRoleArgs =
com.pulumi.vault.tokenauth.AuthBackendRoleArgs.builder()
.allowedEntityAliases(allowedEntityAliases?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.allowedPolicies(allowedPolicies?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.allowedPoliciesGlobs(allowedPoliciesGlobs?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.disallowedPolicies(disallowedPolicies?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.disallowedPoliciesGlobs(
disallowedPoliciesGlobs?.applyValue({ args0 ->
args0.map({ args0 ->
args0
})
}),
)
.namespace(namespace?.applyValue({ args0 -> args0 }))
.orphan(orphan?.applyValue({ args0 -> args0 }))
.pathSuffix(pathSuffix?.applyValue({ args0 -> args0 }))
.renewable(renewable?.applyValue({ args0 -> args0 }))
.roleName(roleName?.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 allowedEntityAliases: Output>? = null
private var allowedPolicies: Output>? = null
private var allowedPoliciesGlobs: Output>? = null
private var disallowedPolicies: Output>? = null
private var disallowedPoliciesGlobs: Output>? = null
private var namespace: Output? = null
private var orphan: Output? = null
private var pathSuffix: Output? = null
private var renewable: Output? = null
private var roleName: 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 List of allowed entity aliases.
*/
@JvmName("ypaxqshibseghcnk")
public suspend fun allowedEntityAliases(`value`: Output>) {
this.allowedEntityAliases = value
}
@JvmName("urhkxwledvwoverb")
public suspend fun allowedEntityAliases(vararg values: Output) {
this.allowedEntityAliases = Output.all(values.asList())
}
/**
* @param values List of allowed entity aliases.
*/
@JvmName("olbelgalpeibscbe")
public suspend fun allowedEntityAliases(values: List