1. Packages
  2. Packages
  3. Auth0 Provider
  4. API Docs
  5. OrganizationMember
Viewing docs for Auth0 v2.24.3 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
auth0 logo
Viewing docs for Auth0 v2.24.3 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    This resource is used to manage the assignment of members and their roles within an organization.

    !> This resource appends a member to an organization. In contrast, the auth0.OrganizationMembers resource manages all the members assigned to an organization. To avoid potential issues, it is recommended not to use this resource in conjunction with the auth0.OrganizationMembers resource when managing members for the same organization id.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Auth0 = Pulumi.Auth0;
    
    return await Deployment.RunAsync(() => 
    {
        var user = new Auth0.User("user", new()
        {
            Email = "test-user@auth0.com",
            ConnectionName = "Username-Password-Authentication",
            EmailVerified = true,
            Password = "MyPass123$",
        });
    
        var myOrg = new Auth0.Organization("myOrg", new()
        {
            DisplayName = "Admin",
        });
    
        var myOrgMember = new Auth0.OrganizationMember("myOrgMember", new()
        {
            OrganizationId = myOrg.Id,
            UserId = user.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-auth0/sdk/v2/go/auth0"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		user, err := auth0.NewUser(ctx, "user", &auth0.UserArgs{
    			Email:          pulumi.String("test-user@auth0.com"),
    			ConnectionName: pulumi.String("Username-Password-Authentication"),
    			EmailVerified:  pulumi.Bool(true),
    			Password:       pulumi.String("MyPass123$"),
    		})
    		if err != nil {
    			return err
    		}
    		myOrg, err := auth0.NewOrganization(ctx, "myOrg", &auth0.OrganizationArgs{
    			DisplayName: pulumi.String("Admin"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = auth0.NewOrganizationMember(ctx, "myOrgMember", &auth0.OrganizationMemberArgs{
    			OrganizationId: myOrg.ID(),
    			UserId:         user.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.auth0.User;
    import com.pulumi.auth0.UserArgs;
    import com.pulumi.auth0.Organization;
    import com.pulumi.auth0.OrganizationArgs;
    import com.pulumi.auth0.OrganizationMember;
    import com.pulumi.auth0.OrganizationMemberArgs;
    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 user = new User("user", UserArgs.builder()        
                .email("test-user@auth0.com")
                .connectionName("Username-Password-Authentication")
                .emailVerified(true)
                .password("MyPass123$")
                .build());
    
            var myOrg = new Organization("myOrg", OrganizationArgs.builder()        
                .displayName("Admin")
                .build());
    
            var myOrgMember = new OrganizationMember("myOrgMember", OrganizationMemberArgs.builder()        
                .organizationId(myOrg.id())
                .userId(user.id())
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as auth0 from "@pulumi/auth0";
    
    const user = new auth0.User("user", {
        email: "test-user@auth0.com",
        connectionName: "Username-Password-Authentication",
        emailVerified: true,
        password: "MyPass123$",
    });
    const myOrg = new auth0.Organization("myOrg", {displayName: "Admin"});
    const myOrgMember = new auth0.OrganizationMember("myOrgMember", {
        organizationId: myOrg.id,
        userId: user.id,
    });
    
    import pulumi
    import pulumi_auth0 as auth0
    
    user = auth0.User("user",
        email="test-user@auth0.com",
        connection_name="Username-Password-Authentication",
        email_verified=True,
        password="MyPass123$")
    my_org = auth0.Organization("myOrg", display_name="Admin")
    my_org_member = auth0.OrganizationMember("myOrgMember",
        organization_id=my_org.id,
        user_id=user.id)
    
    resources:
      user:
        type: auth0:User
        properties:
          email: test-user@auth0.com
          connectionName: Username-Password-Authentication
          emailVerified: true
          password: MyPass123$
      myOrg:
        type: auth0:Organization
        properties:
          displayName: Admin
      myOrgMember:
        type: auth0:OrganizationMember
        properties:
          organizationId: ${myOrg.id}
          userId: ${user.id}
    

    Create OrganizationMember Resource

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

    Constructor syntax

    new OrganizationMember(name: string, args: OrganizationMemberArgs, opts?: CustomResourceOptions);
    @overload
    def OrganizationMember(resource_name: str,
                           args: OrganizationMemberArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrganizationMember(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           organization_id: Optional[str] = None,
                           user_id: Optional[str] = None,
                           roles: Optional[Sequence[str]] = None)
    func NewOrganizationMember(ctx *Context, name string, args OrganizationMemberArgs, opts ...ResourceOption) (*OrganizationMember, error)
    public OrganizationMember(string name, OrganizationMemberArgs args, CustomResourceOptions? opts = null)
    public OrganizationMember(String name, OrganizationMemberArgs args)
    public OrganizationMember(String name, OrganizationMemberArgs args, CustomResourceOptions options)
    
    type: auth0:OrganizationMember
    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 OrganizationMemberArgs
    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 OrganizationMemberArgs
    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 OrganizationMemberArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrganizationMemberArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrganizationMemberArgs
    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 organizationMemberResource = new Auth0.OrganizationMember("organizationMemberResource", new()
    {
        OrganizationId = "string",
        UserId = "string",
    });
    
    example, err := auth0.NewOrganizationMember(ctx, "organizationMemberResource", &auth0.OrganizationMemberArgs{
    	OrganizationId: pulumi.String("string"),
    	UserId:         pulumi.String("string"),
    })
    
    var organizationMemberResource = new OrganizationMember("organizationMemberResource", OrganizationMemberArgs.builder()
        .organizationId("string")
        .userId("string")
        .build());
    
    organization_member_resource = auth0.OrganizationMember("organizationMemberResource",
        organization_id="string",
        user_id="string")
    
    const organizationMemberResource = new auth0.OrganizationMember("organizationMemberResource", {
        organizationId: "string",
        userId: "string",
    });
    
    type: auth0:OrganizationMember
    properties:
        organizationId: string
        userId: string
    

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

    OrganizationId string
    The ID of the organization to assign the member to.
    UserId string
    ID of the user to add as an organization member.
    Roles List<string>
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    OrganizationId string
    The ID of the organization to assign the member to.
    UserId string
    ID of the user to add as an organization member.
    Roles []string
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    organizationId String
    The ID of the organization to assign the member to.
    userId String
    ID of the user to add as an organization member.
    roles List<String>
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    organizationId string
    The ID of the organization to assign the member to.
    userId string
    ID of the user to add as an organization member.
    roles string[]
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    organization_id str
    The ID of the organization to assign the member to.
    user_id str
    ID of the user to add as an organization member.
    roles Sequence[str]
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    organizationId String
    The ID of the organization to assign the member to.
    userId String
    ID of the user to add as an organization member.
    roles List<String>
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Outputs

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

    Get an existing OrganizationMember 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?: OrganizationMemberState, opts?: CustomResourceOptions): OrganizationMember
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            organization_id: Optional[str] = None,
            roles: Optional[Sequence[str]] = None,
            user_id: Optional[str] = None) -> OrganizationMember
    func GetOrganizationMember(ctx *Context, name string, id IDInput, state *OrganizationMemberState, opts ...ResourceOption) (*OrganizationMember, error)
    public static OrganizationMember Get(string name, Input<string> id, OrganizationMemberState? state, CustomResourceOptions? opts = null)
    public static OrganizationMember get(String name, Output<String> id, OrganizationMemberState state, CustomResourceOptions options)
    resources:  _:    type: auth0:OrganizationMember    get:      id: ${id}
    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:
    OrganizationId string
    The ID of the organization to assign the member to.
    Roles List<string>
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    UserId string
    ID of the user to add as an organization member.
    OrganizationId string
    The ID of the organization to assign the member to.
    Roles []string
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    UserId string
    ID of the user to add as an organization member.
    organizationId String
    The ID of the organization to assign the member to.
    roles List<String>
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    userId String
    ID of the user to add as an organization member.
    organizationId string
    The ID of the organization to assign the member to.
    roles string[]
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    userId string
    ID of the user to add as an organization member.
    organization_id str
    The ID of the organization to assign the member to.
    roles Sequence[str]
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    user_id str
    ID of the user to add as an organization member.
    organizationId String
    The ID of the organization to assign the member to.
    roles List<String>
    The role ID(s) to assign to the organization member. Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    Deprecated: Managing roles through this attribute is deprecated and it will be removed in a future version. Migrate to the auth0_organization_member_roles or the auth0_organization_member_role resource to manage organization member roles instead. Check the MIGRATION GUIDE on how to do that.

    userId String
    ID of the user to add as an organization member.

    Import

    This resource can be imported by specifying the organization ID and user ID separated by “:”. # Example

     $ pulumi import auth0:index/organizationMember:OrganizationMember my_org_member "org_XXXXX:auth0|XXXXX"
    

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

    Package Details

    Repository
    Auth0 pulumi/pulumi-auth0
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the auth0 Terraform Provider.
    auth0 logo
    Viewing docs for Auth0 v2.24.3 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.