com.pulumi.vault.identity.kotlin.EntityPoliciesArgs.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.identity.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.identity.EntityPoliciesArgs.builder
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Manages policies for an Identity Entity for Vault. The [Identity secrets engine](https://www.vaultproject.io/docs/secrets/identity/index.html) is the identity management solution for Vault.
* ## Example Usage
* ### Exclusive Policies
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const entity = new vault.identity.Entity("entity", {
* name: "entity",
* externalPolicies: true,
* });
* const policies = new vault.identity.EntityPolicies("policies", {
* policies: [
* "default",
* "test",
* ],
* exclusive: true,
* entityId: entity.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* entity = vault.identity.Entity("entity",
* name="entity",
* external_policies=True)
* policies = vault.identity.EntityPolicies("policies",
* policies=[
* "default",
* "test",
* ],
* exclusive=True,
* entity_id=entity.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var entity = new Vault.Identity.Entity("entity", new()
* {
* Name = "entity",
* ExternalPolicies = true,
* });
* var policies = new Vault.Identity.EntityPolicies("policies", new()
* {
* Policies = new[]
* {
* "default",
* "test",
* },
* Exclusive = true,
* EntityId = entity.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/identity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* entity, err := identity.NewEntity(ctx, "entity", &identity.EntityArgs{
* Name: pulumi.String("entity"),
* ExternalPolicies: pulumi.Bool(true),
* })
* if err != nil {
* return err
* }
* _, err = identity.NewEntityPolicies(ctx, "policies", &identity.EntityPoliciesArgs{
* Policies: pulumi.StringArray{
* pulumi.String("default"),
* pulumi.String("test"),
* },
* Exclusive: pulumi.Bool(true),
* EntityId: entity.ID(),
* })
* 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.identity.Entity;
* import com.pulumi.vault.identity.EntityArgs;
* import com.pulumi.vault.identity.EntityPolicies;
* import com.pulumi.vault.identity.EntityPoliciesArgs;
* 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 entity = new Entity("entity", EntityArgs.builder()
* .name("entity")
* .externalPolicies(true)
* .build());
* var policies = new EntityPolicies("policies", EntityPoliciesArgs.builder()
* .policies(
* "default",
* "test")
* .exclusive(true)
* .entityId(entity.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* entity:
* type: vault:identity:Entity
* properties:
* name: entity
* externalPolicies: true
* policies:
* type: vault:identity:EntityPolicies
* properties:
* policies:
* - default
* - test
* exclusive: true
* entityId: ${entity.id}
* ```
*
* ### Non-exclusive Policies
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const entity = new vault.identity.Entity("entity", {
* name: "entity",
* externalPolicies: true,
* });
* const _default = new vault.identity.EntityPolicies("default", {
* policies: [
* "default",
* "test",
* ],
* exclusive: false,
* entityId: entity.id,
* });
* const others = new vault.identity.EntityPolicies("others", {
* policies: ["others"],
* exclusive: false,
* entityId: entity.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* entity = vault.identity.Entity("entity",
* name="entity",
* external_policies=True)
* default = vault.identity.EntityPolicies("default",
* policies=[
* "default",
* "test",
* ],
* exclusive=False,
* entity_id=entity.id)
* others = vault.identity.EntityPolicies("others",
* policies=["others"],
* exclusive=False,
* entity_id=entity.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var entity = new Vault.Identity.Entity("entity", new()
* {
* Name = "entity",
* ExternalPolicies = true,
* });
* var @default = new Vault.Identity.EntityPolicies("default", new()
* {
* Policies = new[]
* {
* "default",
* "test",
* },
* Exclusive = false,
* EntityId = entity.Id,
* });
* var others = new Vault.Identity.EntityPolicies("others", new()
* {
* Policies = new[]
* {
* "others",
* },
* Exclusive = false,
* EntityId = entity.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/identity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* entity, err := identity.NewEntity(ctx, "entity", &identity.EntityArgs{
* Name: pulumi.String("entity"),
* ExternalPolicies: pulumi.Bool(true),
* })
* if err != nil {
* return err
* }
* _, err = identity.NewEntityPolicies(ctx, "default", &identity.EntityPoliciesArgs{
* Policies: pulumi.StringArray{
* pulumi.String("default"),
* pulumi.String("test"),
* },
* Exclusive: pulumi.Bool(false),
* EntityId: entity.ID(),
* })
* if err != nil {
* return err
* }
* _, err = identity.NewEntityPolicies(ctx, "others", &identity.EntityPoliciesArgs{
* Policies: pulumi.StringArray{
* pulumi.String("others"),
* },
* Exclusive: pulumi.Bool(false),
* EntityId: entity.ID(),
* })
* 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.identity.Entity;
* import com.pulumi.vault.identity.EntityArgs;
* import com.pulumi.vault.identity.EntityPolicies;
* import com.pulumi.vault.identity.EntityPoliciesArgs;
* 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 entity = new Entity("entity", EntityArgs.builder()
* .name("entity")
* .externalPolicies(true)
* .build());
* var default_ = new EntityPolicies("default", EntityPoliciesArgs.builder()
* .policies(
* "default",
* "test")
* .exclusive(false)
* .entityId(entity.id())
* .build());
* var others = new EntityPolicies("others", EntityPoliciesArgs.builder()
* .policies("others")
* .exclusive(false)
* .entityId(entity.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* entity:
* type: vault:identity:Entity
* properties:
* name: entity
* externalPolicies: true
* default:
* type: vault:identity:EntityPolicies
* properties:
* policies:
* - default
* - test
* exclusive: false
* entityId: ${entity.id}
* others:
* type: vault:identity:EntityPolicies
* properties:
* policies:
* - others
* exclusive: false
* entityId: ${entity.id}
* ```
*
* @property entityId Entity ID to assign policies to.
* @property exclusive Defaults to `true`.
* If `true`, this resource will take exclusive control of the policies assigned to the entity and will set it equal to what is specified in the resource.
* If set to `false`, this resource will simply ensure that the policies specified in the resource are present in the entity. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.
* @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 policies List of policies to assign to the entity
*/
public data class EntityPoliciesArgs(
public val entityId: Output? = null,
public val exclusive: Output? = null,
public val namespace: Output? = null,
public val policies: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.vault.identity.EntityPoliciesArgs =
com.pulumi.vault.identity.EntityPoliciesArgs.builder()
.entityId(entityId?.applyValue({ args0 -> args0 }))
.exclusive(exclusive?.applyValue({ args0 -> args0 }))
.namespace(namespace?.applyValue({ args0 -> args0 }))
.policies(policies?.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}
/**
* Builder for [EntityPoliciesArgs].
*/
@PulumiTagMarker
public class EntityPoliciesArgsBuilder internal constructor() {
private var entityId: Output? = null
private var exclusive: Output? = null
private var namespace: Output? = null
private var policies: Output>? = null
/**
* @param value Entity ID to assign policies to.
*/
@JvmName("yeilvskppsbesvme")
public suspend fun entityId(`value`: Output) {
this.entityId = value
}
/**
* @param value Defaults to `true`.
* If `true`, this resource will take exclusive control of the policies assigned to the entity and will set it equal to what is specified in the resource.
* If set to `false`, this resource will simply ensure that the policies specified in the resource are present in the entity. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.
*/
@JvmName("nmhcilytwklnpecx")
public suspend fun exclusive(`value`: Output) {
this.exclusive = 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("vwogtngevfenxnrk")
public suspend fun namespace(`value`: Output) {
this.namespace = value
}
/**
* @param value List of policies to assign to the entity
*/
@JvmName("pswlarbqelamthke")
public suspend fun policies(`value`: Output>) {
this.policies = value
}
@JvmName("tqydjbxtjpsaddol")
public suspend fun policies(vararg values: Output) {
this.policies = Output.all(values.asList())
}
/**
* @param values List of policies to assign to the entity
*/
@JvmName("xpjbfweaidgasxis")
public suspend fun policies(values: List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy