EntityPolicies

Manages policies for an Identity Entity for Vault. The Identity secrets engine is the identity management solution for Vault.

Example Usage

Exclusive Policies

using Pulumi;
using Vault = Pulumi.Vault;

class MyStack : Stack
{
    public MyStack()
    {
        var entity = new Vault.Identity.Entity("entity", new Vault.Identity.EntityArgs
        {
            ExternalPolicies = true,
        });
        var policies = new Vault.Identity.EntityPolicies("policies", new Vault.Identity.EntityPoliciesArgs
        {
            Policies = 
            {
                "default",
                "test",
            },
            Exclusive = true,
            EntityId = entity.Id,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-vault/sdk/v4/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{
			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
	})
}
import pulumi
import pulumi_vault as vault

entity = vault.identity.Entity("entity", external_policies=True)
policies = vault.identity.EntityPolicies("policies",
    policies=[
        "default",
        "test",
    ],
    exclusive=True,
    entity_id=entity.id)
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const entity = new vault.identity.Entity("entity", {externalPolicies: true});
const policies = new vault.identity.EntityPolicies("policies", {
    policies: [
        "default",
        "test",
    ],
    exclusive: true,
    entityId: entity.id,
});

Non-exclusive Policies

using Pulumi;
using Vault = Pulumi.Vault;

class MyStack : Stack
{
    public MyStack()
    {
        var entity = new Vault.Identity.Entity("entity", new Vault.Identity.EntityArgs
        {
            ExternalPolicies = true,
        });
        var @default = new Vault.Identity.EntityPolicies("default", new Vault.Identity.EntityPoliciesArgs
        {
            Policies = 
            {
                "default",
                "test",
            },
            Exclusive = false,
            EntityId = entity.Id,
        });
        var others = new Vault.Identity.EntityPolicies("others", new Vault.Identity.EntityPoliciesArgs
        {
            Policies = 
            {
                "others",
            },
            Exclusive = false,
            EntityId = entity.Id,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-vault/sdk/v4/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{
			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
	})
}
import pulumi
import pulumi_vault as vault

entity = vault.identity.Entity("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)
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const entity = new vault.identity.Entity("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,
});

Create a EntityPolicies Resource

new EntityPolicies(name: string, args: EntityPoliciesArgs, opts?: CustomResourceOptions);
@overload
def EntityPolicies(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   entity_id: Optional[str] = None,
                   exclusive: Optional[bool] = None,
                   policies: Optional[Sequence[str]] = None)
@overload
def EntityPolicies(resource_name: str,
                   args: EntityPoliciesArgs,
                   opts: Optional[ResourceOptions] = None)
func NewEntityPolicies(ctx *Context, name string, args EntityPoliciesArgs, opts ...ResourceOption) (*EntityPolicies, error)
public EntityPolicies(string name, EntityPoliciesArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args EntityPoliciesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args EntityPoliciesArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args EntityPoliciesArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EntityPoliciesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

EntityPolicies Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The EntityPolicies resource accepts the following input properties:

EntityId string
Entity ID to assign policies to.
Policies List<string>
List of policies to assign to the entity
Exclusive bool
Defaults to true.
EntityId string
Entity ID to assign policies to.
Policies []string
List of policies to assign to the entity
Exclusive bool
Defaults to true.
entityId string
Entity ID to assign policies to.
policies string[]
List of policies to assign to the entity
exclusive boolean
Defaults to true.
entity_id str
Entity ID to assign policies to.
policies Sequence[str]
List of policies to assign to the entity
exclusive bool
Defaults to true.

Outputs

All input properties are implicitly available as output properties. Additionally, the EntityPolicies resource produces the following output properties:

EntityName string
The name of the entity that are assigned the policies.
Id string
The provider-assigned unique ID for this managed resource.
EntityName string
The name of the entity that are assigned the policies.
Id string
The provider-assigned unique ID for this managed resource.
entityName string
The name of the entity that are assigned the policies.
id string
The provider-assigned unique ID for this managed resource.
entity_name str
The name of the entity that are assigned the policies.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing EntityPolicies Resource

Get an existing EntityPolicies resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: EntityPoliciesState, opts?: CustomResourceOptions): EntityPolicies
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        entity_id: Optional[str] = None,
        entity_name: Optional[str] = None,
        exclusive: Optional[bool] = None,
        policies: Optional[Sequence[str]] = None) -> EntityPolicies
func GetEntityPolicies(ctx *Context, name string, id IDInput, state *EntityPoliciesState, opts ...ResourceOption) (*EntityPolicies, error)
public static EntityPolicies Get(string name, Input<string> id, EntityPoliciesState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

EntityId string
Entity ID to assign policies to.
EntityName string
The name of the entity that are assigned the policies.
Exclusive bool
Defaults to true.
Policies List<string>
List of policies to assign to the entity
EntityId string
Entity ID to assign policies to.
EntityName string
The name of the entity that are assigned the policies.
Exclusive bool
Defaults to true.
Policies []string
List of policies to assign to the entity
entityId string
Entity ID to assign policies to.
entityName string
The name of the entity that are assigned the policies.
exclusive boolean
Defaults to true.
policies string[]
List of policies to assign to the entity
entity_id str
Entity ID to assign policies to.
entity_name str
The name of the entity that are assigned the policies.
exclusive bool
Defaults to true.
policies Sequence[str]
List of policies to assign to the entity

Package Details

Repository
https://github.com/pulumi/pulumi-vault
License
Apache-2.0
Notes
This Pulumi package is based on the vault Terraform Provider.