1. Packages
  2. HashiCorp Vault
  3. API Docs
  4. identity
  5. GroupPolicies
HashiCorp Vault v6.0.0 published on Monday, Mar 25, 2024 by Pulumi

vault.identity.GroupPolicies

Explore with Pulumi AI

vault logo
HashiCorp Vault v6.0.0 published on Monday, Mar 25, 2024 by Pulumi

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

    Example Usage

    Exclusive Policies

    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,
    });
    
    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)
    
    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 {
    		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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var @internal = new Vault.Identity.Group("internal", new()
        {
            Type = "internal",
            ExternalPolicies = true,
            Metadata = 
            {
                { "version", "2" },
            },
        });
    
        var policies = new Vault.Identity.GroupPolicies("policies", new()
        {
            Policies = new[]
            {
                "default",
                "test",
            },
            Exclusive = true,
            GroupId = @internal.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.identity.GroupPolicies;
    import com.pulumi.vault.identity.GroupPoliciesArgs;
    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 internal = new Group("internal", GroupArgs.builder()        
                .type("internal")
                .externalPolicies(true)
                .metadata(Map.of("version", "2"))
                .build());
    
            var policies = new GroupPolicies("policies", GroupPoliciesArgs.builder()        
                .policies(            
                    "default",
                    "test")
                .exclusive(true)
                .groupId(internal.id())
                .build());
    
        }
    }
    
    resources:
      internal:
        type: vault:identity:Group
        properties:
          type: internal
          externalPolicies: true
          metadata:
            version: '2'
      policies:
        type: vault:identity:GroupPolicies
        properties:
          policies:
            - default
            - test
          exclusive: true
          groupId: ${internal.id}
    

    Non-exclusive Policies

    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,
    });
    
    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)
    
    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 {
    		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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var @internal = new Vault.Identity.Group("internal", new()
        {
            Type = "internal",
            ExternalPolicies = true,
            Metadata = 
            {
                { "version", "2" },
            },
        });
    
        var @default = new Vault.Identity.GroupPolicies("default", new()
        {
            Policies = new[]
            {
                "default",
                "test",
            },
            Exclusive = false,
            GroupId = @internal.Id,
        });
    
        var others = new Vault.Identity.GroupPolicies("others", new()
        {
            Policies = new[]
            {
                "others",
            },
            Exclusive = false,
            GroupId = @internal.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.identity.GroupPolicies;
    import com.pulumi.vault.identity.GroupPoliciesArgs;
    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 internal = new Group("internal", GroupArgs.builder()        
                .type("internal")
                .externalPolicies(true)
                .metadata(Map.of("version", "2"))
                .build());
    
            var default_ = new GroupPolicies("default", GroupPoliciesArgs.builder()        
                .policies(            
                    "default",
                    "test")
                .exclusive(false)
                .groupId(internal.id())
                .build());
    
            var others = new GroupPolicies("others", GroupPoliciesArgs.builder()        
                .policies("others")
                .exclusive(false)
                .groupId(internal.id())
                .build());
    
        }
    }
    
    resources:
      internal:
        type: vault:identity:Group
        properties:
          type: internal
          externalPolicies: true
          metadata:
            version: '2'
      default:
        type: vault:identity:GroupPolicies
        properties:
          policies:
            - default
            - test
          exclusive: false
          groupId: ${internal.id}
      others:
        type: vault:identity:GroupPolicies
        properties:
          policies:
            - others
          exclusive: false
          groupId: ${internal.id}
    

    Create 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,
                      namespace: 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)
    public GroupPolicies(String name, GroupPoliciesArgs args)
    public GroupPolicies(String name, GroupPoliciesArgs args, CustomResourceOptions options)
    
    type: vault:identity:GroupPolicies
    properties: # The arguments to resource properties.
    options: # 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.
    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.
    name String
    The unique name of the resource.
    args GroupPoliciesArgs
    The arguments to resource properties.
    options 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.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    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.
    GroupId string
    Group ID to assign policies to.
    Policies []string
    List of policies to assign to the group
    Exclusive bool

    Defaults to true.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    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.
    groupId String
    Group ID to assign policies to.
    policies List<String>
    List of policies to assign to the group
    exclusive Boolean

    Defaults to true.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    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.
    groupId string
    Group ID to assign policies to.
    policies string[]
    List of policies to assign to the group
    exclusive boolean

    Defaults to true.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    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.
    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.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    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.
    groupId String
    Group ID to assign policies to.
    policies List<String>
    List of policies to assign to the group
    exclusive Boolean

    Defaults to true.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    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 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.
    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.
    groupName String
    The name of the group that are assigned the policies.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up 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,
            namespace: 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)
    public static GroupPolicies get(String name, Output<String> id, GroupPoliciesState 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:
    Exclusive bool

    Defaults to true.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    GroupId string
    Group ID to assign policies to.
    GroupName string
    The name of the group that are assigned the policies.
    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.
    Policies List<string>
    List of policies to assign to the group
    Exclusive bool

    Defaults to true.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    GroupId string
    Group ID to assign policies to.
    GroupName string
    The name of the group that are assigned the policies.
    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.
    Policies []string
    List of policies to assign to the group
    exclusive Boolean

    Defaults to true.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    groupId String
    Group ID to assign policies to.
    groupName String
    The name of the group that are assigned the policies.
    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.
    policies List<String>
    List of policies to assign to the group
    exclusive boolean

    Defaults to true.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    groupId string
    Group ID to assign policies to.
    groupName string
    The name of the group that are assigned the policies.
    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.
    policies string[]
    List of policies to assign to the group
    exclusive bool

    Defaults to true.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    group_id str
    Group ID to assign policies to.
    group_name str
    The name of the group that are assigned the policies.
    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.
    policies Sequence[str]
    List of policies to assign to the group
    exclusive Boolean

    Defaults to true.

    If true, this resource will take exclusive control of the policies assigned to the group 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 group. When destroying the resource, the resource will ensure that the policies specified in the resource are removed.

    groupId String
    Group ID to assign policies to.
    groupName String
    The name of the group that are assigned the policies.
    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.
    policies List<String>
    List of policies to assign to the group

    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.0.0 published on Monday, Mar 25, 2024 by Pulumi