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

vault.identity.OidcAssignment

Explore with Pulumi AI

Manages OIDC Assignments in a Vault server. See the Vault documentation for more information.

Example Usage

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

const internal = new vault.identity.Group("internal", {
    name: "internal",
    type: "internal",
    policies: [
        "dev",
        "test",
    ],
});
const test = new vault.identity.Entity("test", {
    name: "test",
    policies: ["test"],
});
const _default = new vault.identity.OidcAssignment("default", {
    name: "assignment",
    entityIds: [test.id],
    groupIds: [internal.id],
});
Copy
import pulumi
import pulumi_vault as vault

internal = vault.identity.Group("internal",
    name="internal",
    type="internal",
    policies=[
        "dev",
        "test",
    ])
test = vault.identity.Entity("test",
    name="test",
    policies=["test"])
default = vault.identity.OidcAssignment("default",
    name="assignment",
    entity_ids=[test.id],
    group_ids=[internal.id])
Copy
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{
			Name: pulumi.String("internal"),
			Type: pulumi.String("internal"),
			Policies: pulumi.StringArray{
				pulumi.String("dev"),
				pulumi.String("test"),
			},
		})
		if err != nil {
			return err
		}
		test, err := identity.NewEntity(ctx, "test", &identity.EntityArgs{
			Name: pulumi.String("test"),
			Policies: pulumi.StringArray{
				pulumi.String("test"),
			},
		})
		if err != nil {
			return err
		}
		_, err = identity.NewOidcAssignment(ctx, "default", &identity.OidcAssignmentArgs{
			Name: pulumi.String("assignment"),
			EntityIds: pulumi.StringArray{
				test.ID(),
			},
			GroupIds: pulumi.StringArray{
				internal.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 @internal = new Vault.Identity.Group("internal", new()
    {
        Name = "internal",
        Type = "internal",
        Policies = new[]
        {
            "dev",
            "test",
        },
    });

    var test = new Vault.Identity.Entity("test", new()
    {
        Name = "test",
        Policies = new[]
        {
            "test",
        },
    });

    var @default = new Vault.Identity.OidcAssignment("default", new()
    {
        Name = "assignment",
        EntityIds = new[]
        {
            test.Id,
        },
        GroupIds = new[]
        {
            @internal.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.identity.Entity;
import com.pulumi.vault.identity.EntityArgs;
import com.pulumi.vault.identity.OidcAssignment;
import com.pulumi.vault.identity.OidcAssignmentArgs;
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()
            .name("internal")
            .type("internal")
            .policies(            
                "dev",
                "test")
            .build());

        var test = new Entity("test", EntityArgs.builder()
            .name("test")
            .policies("test")
            .build());

        var default_ = new OidcAssignment("default", OidcAssignmentArgs.builder()
            .name("assignment")
            .entityIds(test.id())
            .groupIds(internal.id())
            .build());

    }
}
Copy
resources:
  internal:
    type: vault:identity:Group
    properties:
      name: internal
      type: internal
      policies:
        - dev
        - test
  test:
    type: vault:identity:Entity
    properties:
      name: test
      policies:
        - test
  default:
    type: vault:identity:OidcAssignment
    properties:
      name: assignment
      entityIds:
        - ${test.id}
      groupIds:
        - ${internal.id}
Copy

Create OidcAssignment Resource

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

Constructor syntax

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

@overload
def OidcAssignment(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   entity_ids: Optional[Sequence[str]] = None,
                   group_ids: Optional[Sequence[str]] = None,
                   name: Optional[str] = None,
                   namespace: Optional[str] = None)
func NewOidcAssignment(ctx *Context, name string, args *OidcAssignmentArgs, opts ...ResourceOption) (*OidcAssignment, error)
public OidcAssignment(string name, OidcAssignmentArgs? args = null, CustomResourceOptions? opts = null)
public OidcAssignment(String name, OidcAssignmentArgs args)
public OidcAssignment(String name, OidcAssignmentArgs args, CustomResourceOptions options)
type: vault:identity:OidcAssignment
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 OidcAssignmentArgs
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 OidcAssignmentArgs
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 OidcAssignmentArgs
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 OidcAssignmentArgs
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. OidcAssignmentArgs
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 oidcAssignmentResource = new Vault.Identity.OidcAssignment("oidcAssignmentResource", new()
{
    EntityIds = new[]
    {
        "string",
    },
    GroupIds = new[]
    {
        "string",
    },
    Name = "string",
    Namespace = "string",
});
Copy
example, err := identity.NewOidcAssignment(ctx, "oidcAssignmentResource", &identity.OidcAssignmentArgs{
	EntityIds: pulumi.StringArray{
		pulumi.String("string"),
	},
	GroupIds: pulumi.StringArray{
		pulumi.String("string"),
	},
	Name:      pulumi.String("string"),
	Namespace: pulumi.String("string"),
})
Copy
var oidcAssignmentResource = new OidcAssignment("oidcAssignmentResource", OidcAssignmentArgs.builder()
    .entityIds("string")
    .groupIds("string")
    .name("string")
    .namespace("string")
    .build());
Copy
oidc_assignment_resource = vault.identity.OidcAssignment("oidcAssignmentResource",
    entity_ids=["string"],
    group_ids=["string"],
    name="string",
    namespace="string")
Copy
const oidcAssignmentResource = new vault.identity.OidcAssignment("oidcAssignmentResource", {
    entityIds: ["string"],
    groupIds: ["string"],
    name: "string",
    namespace: "string",
});
Copy
type: vault:identity:OidcAssignment
properties:
    entityIds:
        - string
    groupIds:
        - string
    name: string
    namespace: string
Copy

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

EntityIds List<string>
A set of Vault entity IDs.
GroupIds List<string>
A set of Vault group IDs.
Name Changes to this property will trigger replacement. string
The name of the assignment.
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.
EntityIds []string
A set of Vault entity IDs.
GroupIds []string
A set of Vault group IDs.
Name Changes to this property will trigger replacement. string
The name of the assignment.
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.
entityIds List<String>
A set of Vault entity IDs.
groupIds List<String>
A set of Vault group IDs.
name Changes to this property will trigger replacement. String
The name of the assignment.
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.
entityIds string[]
A set of Vault entity IDs.
groupIds string[]
A set of Vault group IDs.
name Changes to this property will trigger replacement. string
The name of the assignment.
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.
entity_ids Sequence[str]
A set of Vault entity IDs.
group_ids Sequence[str]
A set of Vault group IDs.
name Changes to this property will trigger replacement. str
The name of the assignment.
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.
entityIds List<String>
A set of Vault entity IDs.
groupIds List<String>
A set of Vault group IDs.
name Changes to this property will trigger replacement. String
The name of the assignment.
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 OidcAssignment 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 OidcAssignment Resource

Get an existing OidcAssignment 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?: OidcAssignmentState, opts?: CustomResourceOptions): OidcAssignment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        entity_ids: Optional[Sequence[str]] = None,
        group_ids: Optional[Sequence[str]] = None,
        name: Optional[str] = None,
        namespace: Optional[str] = None) -> OidcAssignment
func GetOidcAssignment(ctx *Context, name string, id IDInput, state *OidcAssignmentState, opts ...ResourceOption) (*OidcAssignment, error)
public static OidcAssignment Get(string name, Input<string> id, OidcAssignmentState? state, CustomResourceOptions? opts = null)
public static OidcAssignment get(String name, Output<String> id, OidcAssignmentState state, CustomResourceOptions options)
resources:  _:    type: vault:identity:OidcAssignment    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:
EntityIds List<string>
A set of Vault entity IDs.
GroupIds List<string>
A set of Vault group IDs.
Name Changes to this property will trigger replacement. string
The name of the assignment.
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.
EntityIds []string
A set of Vault entity IDs.
GroupIds []string
A set of Vault group IDs.
Name Changes to this property will trigger replacement. string
The name of the assignment.
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.
entityIds List<String>
A set of Vault entity IDs.
groupIds List<String>
A set of Vault group IDs.
name Changes to this property will trigger replacement. String
The name of the assignment.
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.
entityIds string[]
A set of Vault entity IDs.
groupIds string[]
A set of Vault group IDs.
name Changes to this property will trigger replacement. string
The name of the assignment.
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.
entity_ids Sequence[str]
A set of Vault entity IDs.
group_ids Sequence[str]
A set of Vault group IDs.
name Changes to this property will trigger replacement. str
The name of the assignment.
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.
entityIds List<String>
A set of Vault entity IDs.
groupIds List<String>
A set of Vault group IDs.
name Changes to this property will trigger replacement. String
The name of the assignment.
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

OIDC Assignments can be imported using the name, e.g.

$ pulumi import vault:identity/oidcAssignment:OidcAssignment default assignment
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.