1. Packages
  2. Auth0 Provider
  3. API Docs
  4. OrganizationMember
Auth0 v3.8.3 published on Wednesday, Nov 6, 2024 by Pulumi

auth0.OrganizationMember

Explore with Pulumi AI

auth0 logo
Auth0 v3.8.3 published on Wednesday, Nov 6, 2024 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

    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("my_org", {
        name: "org-admin",
        displayName: "Admin",
    });
    const myOrgMember = new auth0.OrganizationMember("my_org_member", {
        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("my_org",
        name="org-admin",
        display_name="Admin")
    my_org_member = auth0.OrganizationMember("my_org_member",
        organization_id=my_org.id,
        user_id=user.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-auth0/sdk/v3/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, "my_org", &auth0.OrganizationArgs{
    			Name:        pulumi.String("org-admin"),
    			DisplayName: pulumi.String("Admin"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = auth0.NewOrganizationMember(ctx, "my_org_member", &auth0.OrganizationMemberArgs{
    			OrganizationId: myOrg.ID(),
    			UserId:         user.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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("my_org", new()
        {
            Name = "org-admin",
            DisplayName = "Admin",
        });
    
        var myOrgMember = new Auth0.OrganizationMember("my_org_member", new()
        {
            OrganizationId = myOrg.Id,
            UserId = user.Id,
        });
    
    });
    
    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()
                .name("org-admin")
                .displayName("Admin")
                .build());
    
            var myOrgMember = new OrganizationMember("myOrgMember", OrganizationMemberArgs.builder()
                .organizationId(myOrg.id())
                .userId(user.id())
                .build());
    
        }
    }
    
    resources:
      user:
        type: auth0:User
        properties:
          email: test-user@auth0.com
          connectionName: Username-Password-Authentication
          emailVerified: true
          password: MyPass123$
      myOrg:
        type: auth0:Organization
        name: my_org
        properties:
          name: org-admin
          displayName: Admin
      myOrgMember:
        type: auth0:OrganizationMember
        name: my_org_member
        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)
    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.
    OrganizationId string
    The ID of the organization to assign the member to.
    UserId string
    ID of the user to add as an organization member.
    organizationId String
    The ID of the organization to assign the member to.
    userId String
    ID of the user to add as an organization member.
    organizationId string
    The ID of the organization to assign the member to.
    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.
    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.
    userId String
    ID of the user to add as an organization member.

    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,
            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)
    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:
    OrganizationId string
    The ID of the organization to assign the member to.
    UserId string
    ID of the user to add as an organization member.
    OrganizationId string
    The ID of the organization to assign the member to.
    UserId string
    ID of the user to add as an organization member.
    organizationId String
    The ID of the organization to assign the member to.
    userId String
    ID of the user to add as an organization member.
    organizationId string
    The ID of the organization to assign the member to.
    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.
    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.
    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 “::” (note the double colon)

    ::

    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
    Auth0 v3.8.3 published on Wednesday, Nov 6, 2024 by Pulumi