1. Packages
  2. HashiCorp Vault Provider
  3. API Docs
  4. identity
  5. GroupAlias
HashiCorp Vault v6.6.0 published on Thursday, Mar 13, 2025 by Pulumi

vault.identity.GroupAlias

Explore with Pulumi AI

Creates an Identity Group Alias for Vault. The Identity secrets engine is the identity management solution for Vault.

Group aliases allows entity membership in external groups to be managed semi-automatically. External group serves as a mapping to a group that is outside of the identity store. External groups can have one (and only one) alias. This alias should map to a notion of group that is outside of the identity store. For example, groups in LDAP, and teams in GitHub. A username in LDAP, belonging to a group in LDAP, can get its entity ID added as a member of a group in Vault automatically during logins and token renewals. This works only if the group in Vault is an external group and has an alias that maps to the group in LDAP. If the user is removed from the group in LDAP, that change gets reflected in Vault only upon the subsequent login or renewal operation.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const group = new vault.identity.Group("group", {
    name: "test",
    type: "external",
    policies: ["test"],
});
const github = new vault.AuthBackend("github", {
    type: "github",
    path: "github",
});
const group_alias = new vault.identity.GroupAlias("group-alias", {
    name: "Github_Team_Slug",
    mountAccessor: github.accessor,
    canonicalId: group.id,
});
Copy
import pulumi
import pulumi_vault as vault

group = vault.identity.Group("group",
    name="test",
    type="external",
    policies=["test"])
github = vault.AuthBackend("github",
    type="github",
    path="github")
group_alias = vault.identity.GroupAlias("group-alias",
    name="Github_Team_Slug",
    mount_accessor=github.accessor,
    canonical_id=group.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
	"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 {
		group, err := identity.NewGroup(ctx, "group", &identity.GroupArgs{
			Name: pulumi.String("test"),
			Type: pulumi.String("external"),
			Policies: pulumi.StringArray{
				pulumi.String("test"),
			},
		})
		if err != nil {
			return err
		}
		github, err := vault.NewAuthBackend(ctx, "github", &vault.AuthBackendArgs{
			Type: pulumi.String("github"),
			Path: pulumi.String("github"),
		})
		if err != nil {
			return err
		}
		_, err = identity.NewGroupAlias(ctx, "group-alias", &identity.GroupAliasArgs{
			Name:          pulumi.String("Github_Team_Slug"),
			MountAccessor: github.Accessor,
			CanonicalId:   group.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vault = Pulumi.Vault;

return await Deployment.RunAsync(() => 
{
    var @group = new Vault.Identity.Group("group", new()
    {
        Name = "test",
        Type = "external",
        Policies = new[]
        {
            "test",
        },
    });

    var github = new Vault.AuthBackend("github", new()
    {
        Type = "github",
        Path = "github",
    });

    var group_alias = new Vault.Identity.GroupAlias("group-alias", new()
    {
        Name = "Github_Team_Slug",
        MountAccessor = github.Accessor,
        CanonicalId = @group.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vault.identity.Group;
import com.pulumi.vault.identity.GroupArgs;
import com.pulumi.vault.AuthBackend;
import com.pulumi.vault.AuthBackendArgs;
import com.pulumi.vault.identity.GroupAlias;
import com.pulumi.vault.identity.GroupAliasArgs;
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 group = new Group("group", GroupArgs.builder()
            .name("test")
            .type("external")
            .policies("test")
            .build());

        var github = new AuthBackend("github", AuthBackendArgs.builder()
            .type("github")
            .path("github")
            .build());

        var group_alias = new GroupAlias("group-alias", GroupAliasArgs.builder()
            .name("Github_Team_Slug")
            .mountAccessor(github.accessor())
            .canonicalId(group.id())
            .build());

    }
}
Copy
resources:
  group:
    type: vault:identity:Group
    properties:
      name: test
      type: external
      policies:
        - test
  github:
    type: vault:AuthBackend
    properties:
      type: github
      path: github
  group-alias:
    type: vault:identity:GroupAlias
    properties:
      name: Github_Team_Slug
      mountAccessor: ${github.accessor}
      canonicalId: ${group.id}
Copy

Create GroupAlias Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new GroupAlias(name: string, args: GroupAliasArgs, opts?: CustomResourceOptions);
@overload
def GroupAlias(resource_name: str,
               args: GroupAliasArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def GroupAlias(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               canonical_id: Optional[str] = None,
               mount_accessor: Optional[str] = None,
               name: Optional[str] = None,
               namespace: Optional[str] = None)
func NewGroupAlias(ctx *Context, name string, args GroupAliasArgs, opts ...ResourceOption) (*GroupAlias, error)
public GroupAlias(string name, GroupAliasArgs args, CustomResourceOptions? opts = null)
public GroupAlias(String name, GroupAliasArgs args)
public GroupAlias(String name, GroupAliasArgs args, CustomResourceOptions options)
type: vault:identity:GroupAlias
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. GroupAliasArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. GroupAliasArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. GroupAliasArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. GroupAliasArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. GroupAliasArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var groupAliasResource = new Vault.Identity.GroupAlias("groupAliasResource", new()
{
    CanonicalId = "string",
    MountAccessor = "string",
    Name = "string",
    Namespace = "string",
});
Copy
example, err := identity.NewGroupAlias(ctx, "groupAliasResource", &identity.GroupAliasArgs{
	CanonicalId:   pulumi.String("string"),
	MountAccessor: pulumi.String("string"),
	Name:          pulumi.String("string"),
	Namespace:     pulumi.String("string"),
})
Copy
var groupAliasResource = new GroupAlias("groupAliasResource", GroupAliasArgs.builder()
    .canonicalId("string")
    .mountAccessor("string")
    .name("string")
    .namespace("string")
    .build());
Copy
group_alias_resource = vault.identity.GroupAlias("groupAliasResource",
    canonical_id="string",
    mount_accessor="string",
    name="string",
    namespace="string")
Copy
const groupAliasResource = new vault.identity.GroupAlias("groupAliasResource", {
    canonicalId: "string",
    mountAccessor: "string",
    name: "string",
    namespace: "string",
});
Copy
type: vault:identity:GroupAlias
properties:
    canonicalId: string
    mountAccessor: string
    name: string
    namespace: string
Copy

GroupAlias Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The GroupAlias resource accepts the following input properties:

CanonicalId This property is required. string
ID of the group to which this is an alias.
MountAccessor This property is required. string
Mount accessor of the authentication backend to which this alias belongs to.
Name This property is required. string
Name of the group alias to create.
Namespace Changes to this property will trigger replacement. string
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. Available only for Vault Enterprise.
CanonicalId This property is required. string
ID of the group to which this is an alias.
MountAccessor This property is required. string
Mount accessor of the authentication backend to which this alias belongs to.
Name This property is required. string
Name of the group alias to create.
Namespace Changes to this property will trigger replacement. string
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. Available only for Vault Enterprise.
canonicalId This property is required. String
ID of the group to which this is an alias.
mountAccessor This property is required. String
Mount accessor of the authentication backend to which this alias belongs to.
name This property is required. String
Name of the group alias to create.
namespace Changes to this property will trigger replacement. String
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. Available only for Vault Enterprise.
canonicalId This property is required. string
ID of the group to which this is an alias.
mountAccessor This property is required. string
Mount accessor of the authentication backend to which this alias belongs to.
name This property is required. string
Name of the group alias to create.
namespace Changes to this property will trigger replacement. string
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. Available only for Vault Enterprise.
canonical_id This property is required. str
ID of the group to which this is an alias.
mount_accessor This property is required. str
Mount accessor of the authentication backend to which this alias belongs to.
name This property is required. str
Name of the group alias to create.
namespace Changes to this property will trigger replacement. str
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. Available only for Vault Enterprise.
canonicalId This property is required. String
ID of the group to which this is an alias.
mountAccessor This property is required. String
Mount accessor of the authentication backend to which this alias belongs to.
name This property is required. String
Name of the group alias to create.
namespace Changes to this property will trigger replacement. String
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. Available only for Vault Enterprise.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing GroupAlias Resource

Get an existing GroupAlias 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?: GroupAliasState, opts?: CustomResourceOptions): GroupAlias
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        canonical_id: Optional[str] = None,
        mount_accessor: Optional[str] = None,
        name: Optional[str] = None,
        namespace: Optional[str] = None) -> GroupAlias
func GetGroupAlias(ctx *Context, name string, id IDInput, state *GroupAliasState, opts ...ResourceOption) (*GroupAlias, error)
public static GroupAlias Get(string name, Input<string> id, GroupAliasState? state, CustomResourceOptions? opts = null)
public static GroupAlias get(String name, Output<String> id, GroupAliasState state, CustomResourceOptions options)
resources:  _:    type: vault:identity:GroupAlias    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CanonicalId string
ID of the group to which this is an alias.
MountAccessor string
Mount accessor of the authentication backend to which this alias belongs to.
Name string
Name of the group alias to create.
Namespace Changes to this property will trigger replacement. string
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. Available only for Vault Enterprise.
CanonicalId string
ID of the group to which this is an alias.
MountAccessor string
Mount accessor of the authentication backend to which this alias belongs to.
Name string
Name of the group alias to create.
Namespace Changes to this property will trigger replacement. string
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. Available only for Vault Enterprise.
canonicalId String
ID of the group to which this is an alias.
mountAccessor String
Mount accessor of the authentication backend to which this alias belongs to.
name String
Name of the group alias to create.
namespace Changes to this property will trigger replacement. String
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. Available only for Vault Enterprise.
canonicalId string
ID of the group to which this is an alias.
mountAccessor string
Mount accessor of the authentication backend to which this alias belongs to.
name string
Name of the group alias to create.
namespace Changes to this property will trigger replacement. string
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. Available only for Vault Enterprise.
canonical_id str
ID of the group to which this is an alias.
mount_accessor str
Mount accessor of the authentication backend to which this alias belongs to.
name str
Name of the group alias to create.
namespace Changes to this property will trigger replacement. str
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. Available only for Vault Enterprise.
canonicalId String
ID of the group to which this is an alias.
mountAccessor String
Mount accessor of the authentication backend to which this alias belongs to.
name String
Name of the group alias to create.
namespace Changes to this property will trigger replacement. String
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. Available only for Vault Enterprise.

Import

The group alias can be imported with the group alias id, for example:

$ pulumi import vault:identity/groupAlias:GroupAlias group-alias id
Copy

Group aliases can also be imported using the UUID of the alias record, e.g.

$ pulumi import vault:identity/groupAlias:GroupAlias alias_name 63104e20-88e4-11eb-8d04-cf7ac9d60157
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Vault pulumi/pulumi-vault
License
Apache-2.0
Notes
This Pulumi package is based on the vault Terraform Provider.