1. Packages
  2. Zitadel
  3. API Docs
  4. OrgMember
zitadel v0.2.0 published on Monday, Mar 24, 2025 by pulumiverse

zitadel.OrgMember

Explore with Pulumi AI

Resource representing the membership of a user on an organization, defined with the given role.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Zitadel = Pulumiverse.Zitadel;

return await Deployment.RunAsync(() => 
{
    var @default = new Zitadel.OrgMember("default", new()
    {
        OrgId = defaultZitadelOrg.Id,
        UserId = defaultZitadelHumanUser.Id,
        Roles = new[]
        {
            "ORG_OWNER",
        },
    });

});
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-zitadel/sdk/go/zitadel"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := zitadel.NewOrgMember(ctx, "default", &zitadel.OrgMemberArgs{
			OrgId:  pulumi.Any(defaultZitadelOrg.Id),
			UserId: pulumi.Any(defaultZitadelHumanUser.Id),
			Roles: pulumi.StringArray{
				pulumi.String("ORG_OWNER"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.zitadel.OrgMember;
import com.pulumi.zitadel.OrgMemberArgs;
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 default_ = new OrgMember("default", OrgMemberArgs.builder()        
            .orgId(defaultZitadelOrg.id())
            .userId(defaultZitadelHumanUser.id())
            .roles("ORG_OWNER")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as zitadel from "@pulumiverse/zitadel";

const _default = new zitadel.OrgMember("default", {
    orgId: defaultZitadelOrg.id,
    userId: defaultZitadelHumanUser.id,
    roles: ["ORG_OWNER"],
});
Copy
import pulumi
import pulumiverse_zitadel as zitadel

default = zitadel.OrgMember("default",
    org_id=default_zitadel_org["id"],
    user_id=default_zitadel_human_user["id"],
    roles=["ORG_OWNER"])
Copy
resources:
  default:
    type: zitadel:OrgMember
    properties:
      orgId: ${defaultZitadelOrg.id}
      userId: ${defaultZitadelHumanUser.id}
      roles:
        - ORG_OWNER
Copy

Create OrgMember Resource

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

Constructor syntax

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

@overload
def OrgMember(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              roles: Optional[Sequence[str]] = None,
              user_id: Optional[str] = None,
              org_id: Optional[str] = None)
func NewOrgMember(ctx *Context, name string, args OrgMemberArgs, opts ...ResourceOption) (*OrgMember, error)
public OrgMember(string name, OrgMemberArgs args, CustomResourceOptions? opts = null)
public OrgMember(String name, OrgMemberArgs args)
public OrgMember(String name, OrgMemberArgs args, CustomResourceOptions options)
type: zitadel:OrgMember
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. OrgMemberArgs
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. OrgMemberArgs
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. OrgMemberArgs
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. OrgMemberArgs
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. OrgMemberArgs
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 orgMemberResource = new Zitadel.OrgMember("orgMemberResource", new()
{
    Roles = new[]
    {
        "string",
    },
    UserId = "string",
    OrgId = "string",
});
Copy
example, err := zitadel.NewOrgMember(ctx, "orgMemberResource", &zitadel.OrgMemberArgs{
	Roles: pulumi.StringArray{
		pulumi.String("string"),
	},
	UserId: pulumi.String("string"),
	OrgId:  pulumi.String("string"),
})
Copy
var orgMemberResource = new OrgMember("orgMemberResource", OrgMemberArgs.builder()
    .roles("string")
    .userId("string")
    .orgId("string")
    .build());
Copy
org_member_resource = zitadel.OrgMember("orgMemberResource",
    roles=["string"],
    user_id="string",
    org_id="string")
Copy
const orgMemberResource = new zitadel.OrgMember("orgMemberResource", {
    roles: ["string"],
    userId: "string",
    orgId: "string",
});
Copy
type: zitadel:OrgMember
properties:
    orgId: string
    roles:
        - string
    userId: string
Copy

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

Roles This property is required. List<string>
List of roles granted
UserId
This property is required.
Changes to this property will trigger replacement.
string
ID of the user
OrgId Changes to this property will trigger replacement. string
ID of the organization
Roles This property is required. []string
List of roles granted
UserId
This property is required.
Changes to this property will trigger replacement.
string
ID of the user
OrgId Changes to this property will trigger replacement. string
ID of the organization
roles This property is required. List<String>
List of roles granted
userId
This property is required.
Changes to this property will trigger replacement.
String
ID of the user
orgId Changes to this property will trigger replacement. String
ID of the organization
roles This property is required. string[]
List of roles granted
userId
This property is required.
Changes to this property will trigger replacement.
string
ID of the user
orgId Changes to this property will trigger replacement. string
ID of the organization
roles This property is required. Sequence[str]
List of roles granted
user_id
This property is required.
Changes to this property will trigger replacement.
str
ID of the user
org_id Changes to this property will trigger replacement. str
ID of the organization
roles This property is required. List<String>
List of roles granted
userId
This property is required.
Changes to this property will trigger replacement.
String
ID of the user
orgId Changes to this property will trigger replacement. String
ID of the organization

Outputs

All input properties are implicitly available as output properties. Additionally, the OrgMember 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 OrgMember Resource

Get an existing OrgMember 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?: OrgMemberState, opts?: CustomResourceOptions): OrgMember
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        org_id: Optional[str] = None,
        roles: Optional[Sequence[str]] = None,
        user_id: Optional[str] = None) -> OrgMember
func GetOrgMember(ctx *Context, name string, id IDInput, state *OrgMemberState, opts ...ResourceOption) (*OrgMember, error)
public static OrgMember Get(string name, Input<string> id, OrgMemberState? state, CustomResourceOptions? opts = null)
public static OrgMember get(String name, Output<String> id, OrgMemberState state, CustomResourceOptions options)
resources:  _:    type: zitadel:OrgMember    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:
OrgId Changes to this property will trigger replacement. string
ID of the organization
Roles List<string>
List of roles granted
UserId Changes to this property will trigger replacement. string
ID of the user
OrgId Changes to this property will trigger replacement. string
ID of the organization
Roles []string
List of roles granted
UserId Changes to this property will trigger replacement. string
ID of the user
orgId Changes to this property will trigger replacement. String
ID of the organization
roles List<String>
List of roles granted
userId Changes to this property will trigger replacement. String
ID of the user
orgId Changes to this property will trigger replacement. string
ID of the organization
roles string[]
List of roles granted
userId Changes to this property will trigger replacement. string
ID of the user
org_id Changes to this property will trigger replacement. str
ID of the organization
roles Sequence[str]
List of roles granted
user_id Changes to this property will trigger replacement. str
ID of the user
orgId Changes to this property will trigger replacement. String
ID of the organization
roles List<String>
List of roles granted
userId Changes to this property will trigger replacement. String
ID of the user

Import

bash The resource can be imported using the ID format <user_id[:org_id]>, e.g.

 $ pulumi import zitadel:index/orgMember:OrgMember imported '123456789012345678:123456789012345678'
Copy

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

Package Details

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