GroupPolicies

Manages policies for an Identity Group 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 @internal = new Vault.Identity.Group("internal", new Vault.Identity.GroupArgs
        {
            Type = "internal",
            ExternalPolicies = true,
            Metadata = 
            {
                { "version", "2" },
            },
        });
        var policies = new Vault.Identity.GroupPolicies("policies", new Vault.Identity.GroupPoliciesArgs
        {
            Policies = 
            {
                "default",
                "test",
            },
            Exclusive = true,
            GroupId = @internal.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 {
		internal, err := identity.NewGroup(ctx, "internal", &identity.GroupArgs{
			Type:             pulumi.String("internal"),
			ExternalPolicies: pulumi.Bool(true),
			Metadata: pulumi.StringMap{
				"version": pulumi.String("2"),
			},
		})
		if err != nil {
			return err
		}
		_, err = identity.NewGroupPolicies(ctx, "policies", &identity.GroupPoliciesArgs{
			Policies: pulumi.StringArray{
				pulumi.String("default"),
				pulumi.String("test"),
			},
			Exclusive: pulumi.Bool(true),
			GroupId:   internal.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_vault as vault

internal = vault.identity.Group("internal",
    type="internal",
    external_policies=True,
    metadata={
        "version": "2",
    })
policies = vault.identity.GroupPolicies("policies",
    policies=[
        "default",
        "test",
    ],
    exclusive=True,
    group_id=internal.id)
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const internal = new vault.identity.Group("internal", {
    type: "internal",
    externalPolicies: true,
    metadata: {
        version: "2",
    },
});
const policies = new vault.identity.GroupPolicies("policies", {
    policies: [
        "default",
        "test",
    ],
    exclusive: true,
    groupId: internal.id,
});

Non-exclusive Policies

using Pulumi;
using Vault = Pulumi.Vault;

class MyStack : Stack
{
    public MyStack()
    {
        var @internal = new Vault.Identity.Group("internal", new Vault.Identity.GroupArgs
        {
            Type = "internal",
            ExternalPolicies = true,
            Metadata = 
            {
                { "version", "2" },
            },
        });
        var @default = new Vault.Identity.GroupPolicies("default", new Vault.Identity.GroupPoliciesArgs
        {
            Policies = 
            {
                "default",
                "test",
            },
            Exclusive = false,
            GroupId = @internal.Id,
        });
        var others = new Vault.Identity.GroupPolicies("others", new Vault.Identity.GroupPoliciesArgs
        {
            Policies = 
            {
                "others",
            },
            Exclusive = false,
            GroupId = @internal.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 {
		internal, err := identity.NewGroup(ctx, "internal", &identity.GroupArgs{
			Type:             pulumi.String("internal"),
			ExternalPolicies: pulumi.Bool(true),
			Metadata: pulumi.StringMap{
				"version": pulumi.String("2"),
			},
		})
		if err != nil {
			return err
		}
		_, err = identity.NewGroupPolicies(ctx, "_default", &identity.GroupPoliciesArgs{
			Policies: pulumi.StringArray{
				pulumi.String("default"),
				pulumi.String("test"),
			},
			Exclusive: pulumi.Bool(false),
			GroupId:   internal.ID(),
		})
		if err != nil {
			return err
		}
		_, err = identity.NewGroupPolicies(ctx, "others", &identity.GroupPoliciesArgs{
			Policies: pulumi.StringArray{
				pulumi.String("others"),
			},
			Exclusive: pulumi.Bool(false),
			GroupId:   internal.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_vault as vault

internal = vault.identity.Group("internal",
    type="internal",
    external_policies=True,
    metadata={
        "version": "2",
    })
default = vault.identity.GroupPolicies("default",
    policies=[
        "default",
        "test",
    ],
    exclusive=False,
    group_id=internal.id)
others = vault.identity.GroupPolicies("others",
    policies=["others"],
    exclusive=False,
    group_id=internal.id)
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const internal = new vault.identity.Group("internal", {
    type: "internal",
    externalPolicies: true,
    metadata: {
        version: "2",
    },
});
const _default = new vault.identity.GroupPolicies("default", {
    policies: [
        "default",
        "test",
    ],
    exclusive: false,
    groupId: internal.id,
});
const others = new vault.identity.GroupPolicies("others", {
    policies: ["others"],
    exclusive: false,
    groupId: internal.id,
});

Create a GroupPolicies Resource

new GroupPolicies(name: string, args: GroupPoliciesArgs, opts?: CustomResourceOptions);
@overload
def GroupPolicies(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  exclusive: Optional[bool] = None,
                  group_id: Optional[str] = None,
                  policies: Optional[Sequence[str]] = None)
@overload
def GroupPolicies(resource_name: str,
                  args: GroupPoliciesArgs,
                  opts: Optional[ResourceOptions] = None)
func NewGroupPolicies(ctx *Context, name string, args GroupPoliciesArgs, opts ...ResourceOption) (*GroupPolicies, error)
public GroupPolicies(string name, GroupPoliciesArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args GroupPoliciesArgs
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 GroupPoliciesArgs
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 GroupPoliciesArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GroupPoliciesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

GroupPolicies 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 GroupPolicies resource accepts the following input properties:

GroupId string
Group ID to assign policies to.
Policies List<string>
List of policies to assign to the group
Exclusive bool
Defaults to true.
GroupId string
Group ID to assign policies to.
Policies []string
List of policies to assign to the group
Exclusive bool
Defaults to true.
groupId string
Group ID to assign policies to.
policies string[]
List of policies to assign to the group
exclusive boolean
Defaults to true.
group_id str
Group ID to assign policies to.
policies Sequence[str]
List of policies to assign to the group
exclusive bool
Defaults to true.

Outputs

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

GroupName string
The name of the group that are assigned the policies.
Id string
The provider-assigned unique ID for this managed resource.
GroupName string
The name of the group that are assigned the policies.
Id string
The provider-assigned unique ID for this managed resource.
groupName string
The name of the group that are assigned the policies.
id string
The provider-assigned unique ID for this managed resource.
group_name str
The name of the group that are assigned the policies.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing GroupPolicies Resource

Get an existing GroupPolicies 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?: GroupPoliciesState, opts?: CustomResourceOptions): GroupPolicies
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        exclusive: Optional[bool] = None,
        group_id: Optional[str] = None,
        group_name: Optional[str] = None,
        policies: Optional[Sequence[str]] = None) -> GroupPolicies
func GetGroupPolicies(ctx *Context, name string, id IDInput, state *GroupPoliciesState, opts ...ResourceOption) (*GroupPolicies, error)
public static GroupPolicies Get(string name, Input<string> id, GroupPoliciesState? 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:

Exclusive bool
Defaults to true.
GroupId string
Group ID to assign policies to.
GroupName string
The name of the group that are assigned the policies.
Policies List<string>
List of policies to assign to the group
Exclusive bool
Defaults to true.
GroupId string
Group ID to assign policies to.
GroupName string
The name of the group that are assigned the policies.
Policies []string
List of policies to assign to the group
exclusive boolean
Defaults to true.
groupId string
Group ID to assign policies to.
groupName string
The name of the group that are assigned the policies.
policies string[]
List of policies to assign to the group
exclusive bool
Defaults to true.
group_id str
Group ID to assign policies to.
group_name str
The name of the group that are assigned the policies.
policies Sequence[str]
List of policies to assign to the group

Package Details

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