1. Packages
  2. HashiCorp Vault
  3. API Docs
  4. identity
  5. GroupAlias
HashiCorp Vault v6.1.0 published on Thursday, Apr 4, 2024 by Pulumi

vault.identity.GroupAlias

Explore with Pulumi AI

vault logo
HashiCorp Vault v6.1.0 published on Thursday, Apr 4, 2024 by Pulumi

    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", {
        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,
    });
    
    import pulumi
    import pulumi_vault as vault
    
    group = vault.identity.Group("group",
        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)
    
    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{
    			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
    	})
    }
    
    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()
        {
            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,
        });
    
    });
    
    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()        
                .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());
    
        }
    }
    
    resources:
      group:
        type: vault:identity:Group
        properties:
          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}
    

    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 string
    The unique name of the resource.
    args GroupAliasArgs
    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 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 string
    The unique name of the resource.
    args GroupAliasArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GroupAliasArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GroupAliasArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    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",
    });
    
    example, err := identity.NewGroupAlias(ctx, "groupAliasResource", &identity.GroupAliasArgs{
    	CanonicalId:   pulumi.String("string"),
    	MountAccessor: pulumi.String("string"),
    	Name:          pulumi.String("string"),
    	Namespace:     pulumi.String("string"),
    })
    
    var groupAliasResource = new GroupAlias("groupAliasResource", GroupAliasArgs.builder()        
        .canonicalId("string")
        .mountAccessor("string")
        .name("string")
        .namespace("string")
        .build());
    
    group_alias_resource = vault.identity.GroupAlias("groupAliasResource",
        canonical_id="string",
        mount_accessor="string",
        name="string",
        namespace="string")
    
    const groupAliasResource = new vault.identity.GroupAlias("groupAliasResource", {
        canonicalId: "string",
        mountAccessor: "string",
        name: "string",
        namespace: "string",
    });
    
    type: vault:identity:GroupAlias
    properties:
        canonicalId: string
        mountAccessor: string
        name: string
        namespace: string
    

    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

    The GroupAlias resource accepts the following input properties:

    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 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 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 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 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 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 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)
    Resource lookup is not supported in YAML
    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.
    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:
    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 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 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 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 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 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 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
    

    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
    

    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.
    vault logo
    HashiCorp Vault v6.1.0 published on Thursday, Apr 4, 2024 by Pulumi