1. Packages
  2. Mongodbatlas Provider
  3. API Docs
  4. CloudUserOrgAssignment
MongoDB Atlas v4.0.0 published on Tuesday, Dec 30, 2025 by Pulumi
mongodbatlas logo
MongoDB Atlas v4.0.0 published on Tuesday, Dec 30, 2025 by Pulumi

    mongodbatlas.CloudUserOrgAssignment provides a Cloud User Organization Assignment resource. The resource lets you import, assign, remove, or update a user to an organization.

    NOTE: Users with pending invitations created using the deprecated mongodbatlas.ProjectInvitation resource or via the deprecated Invite One MongoDB Cloud User to One Project endpoint cannot be managed with this resource. See MongoDB Atlas API for details. To manage such users with this resource, refer to our Org Invitation to Cloud User Org Assignment Migration Guide.

    Example Usage

    S

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const example = new mongodbatlas.CloudUserOrgAssignment("example", {
        orgId: orgId,
        username: userEmail,
        roles: {
            orgRoles: ["ORG_MEMBER"],
        },
    });
    const exampleUsername = example.username.apply(username => mongodbatlas.getCloudUserOrgAssignmentOutput({
        orgId: orgId,
        username: username,
    }));
    const exampleUserId = example.userId.apply(userId => mongodbatlas.getCloudUserOrgAssignmentOutput({
        orgId: orgId,
        userId: userId,
    }));
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    example = mongodbatlas.CloudUserOrgAssignment("example",
        org_id=org_id,
        username=user_email,
        roles={
            "org_roles": ["ORG_MEMBER"],
        })
    example_username = example.username.apply(lambda username: mongodbatlas.get_cloud_user_org_assignment_output(org_id=org_id,
        username=username))
    example_user_id = example.user_id.apply(lambda user_id: mongodbatlas.get_cloud_user_org_assignment_output(org_id=org_id,
        user_id=user_id))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-mongodbatlas/sdk/v4/go/mongodbatlas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := mongodbatlas.NewCloudUserOrgAssignment(ctx, "example", &mongodbatlas.CloudUserOrgAssignmentArgs{
    			OrgId:    pulumi.Any(orgId),
    			Username: pulumi.Any(userEmail),
    			Roles: &mongodbatlas.CloudUserOrgAssignmentRolesArgs{
    				OrgRoles: pulumi.StringArray{
    					pulumi.String("ORG_MEMBER"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_ = example.Username.ApplyT(func(username string) (mongodbatlas.GetCloudUserOrgAssignmentResult, error) {
    			return mongodbatlas.GetCloudUserOrgAssignmentResult(interface{}(mongodbatlas.LookupCloudUserOrgAssignment(ctx, &mongodbatlas.LookupCloudUserOrgAssignmentArgs{
    				OrgId:    orgId,
    				Username: pulumi.StringRef(pulumi.StringRef(username)),
    			}, nil))), nil
    		}).(mongodbatlas.GetCloudUserOrgAssignmentResultOutput)
    		_ = example.UserId.ApplyT(func(userId string) (mongodbatlas.GetCloudUserOrgAssignmentResult, error) {
    			return mongodbatlas.GetCloudUserOrgAssignmentResult(interface{}(mongodbatlas.LookupCloudUserOrgAssignment(ctx, &mongodbatlas.LookupCloudUserOrgAssignmentArgs{
    				OrgId:  orgId,
    				UserId: pulumi.StringRef(pulumi.StringRef(userId)),
    			}, nil))), nil
    		}).(mongodbatlas.GetCloudUserOrgAssignmentResultOutput)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Mongodbatlas.CloudUserOrgAssignment("example", new()
        {
            OrgId = orgId,
            Username = userEmail,
            Roles = new Mongodbatlas.Inputs.CloudUserOrgAssignmentRolesArgs
            {
                OrgRoles = new[]
                {
                    "ORG_MEMBER",
                },
            },
        });
    
        var exampleUsername = Mongodbatlas.GetCloudUserOrgAssignment.Invoke(new()
        {
            OrgId = orgId,
            Username = example.Username,
        });
    
        var exampleUserId = Mongodbatlas.GetCloudUserOrgAssignment.Invoke(new()
        {
            OrgId = orgId,
            UserId = example.UserId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.CloudUserOrgAssignment;
    import com.pulumi.mongodbatlas.CloudUserOrgAssignmentArgs;
    import com.pulumi.mongodbatlas.inputs.CloudUserOrgAssignmentRolesArgs;
    import com.pulumi.mongodbatlas.MongodbatlasFunctions;
    import com.pulumi.mongodbatlas.inputs.GetCloudUserOrgAssignmentArgs;
    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 example = new CloudUserOrgAssignment("example", CloudUserOrgAssignmentArgs.builder()
                .orgId(orgId)
                .username(userEmail)
                .roles(CloudUserOrgAssignmentRolesArgs.builder()
                    .orgRoles("ORG_MEMBER")
                    .build())
                .build());
    
            final var exampleUsername = example.username().applyValue(_username -> MongodbatlasFunctions.getCloudUserOrgAssignment(GetCloudUserOrgAssignmentArgs.builder()
                .orgId(orgId)
                .username(_username)
                .build()));
    
            final var exampleUserId = example.userId().applyValue(_userId -> MongodbatlasFunctions.getCloudUserOrgAssignment(GetCloudUserOrgAssignmentArgs.builder()
                .orgId(orgId)
                .userId(_userId)
                .build()));
    
        }
    }
    
    resources:
      example:
        type: mongodbatlas:CloudUserOrgAssignment
        properties:
          orgId: ${orgId}
          username: ${userEmail}
          roles:
            orgRoles:
              - ORG_MEMBER
    variables:
      exampleUsername:
        fn::invoke:
          function: mongodbatlas:getCloudUserOrgAssignment
          arguments:
            orgId: ${orgId}
            username: ${example.username}
      exampleUserId:
        fn::invoke:
          function: mongodbatlas:getCloudUserOrgAssignment
          arguments:
            orgId: ${orgId}
            userId: ${example.userId}
    

    Further Examples

    • Cloud User Organization Assignment

    Create CloudUserOrgAssignment Resource

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

    Constructor syntax

    new CloudUserOrgAssignment(name: string, args: CloudUserOrgAssignmentArgs, opts?: CustomResourceOptions);
    @overload
    def CloudUserOrgAssignment(resource_name: str,
                               args: CloudUserOrgAssignmentArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def CloudUserOrgAssignment(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               org_id: Optional[str] = None,
                               roles: Optional[CloudUserOrgAssignmentRolesArgs] = None,
                               username: Optional[str] = None)
    func NewCloudUserOrgAssignment(ctx *Context, name string, args CloudUserOrgAssignmentArgs, opts ...ResourceOption) (*CloudUserOrgAssignment, error)
    public CloudUserOrgAssignment(string name, CloudUserOrgAssignmentArgs args, CustomResourceOptions? opts = null)
    public CloudUserOrgAssignment(String name, CloudUserOrgAssignmentArgs args)
    public CloudUserOrgAssignment(String name, CloudUserOrgAssignmentArgs args, CustomResourceOptions options)
    
    type: mongodbatlas:CloudUserOrgAssignment
    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 CloudUserOrgAssignmentArgs
    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 CloudUserOrgAssignmentArgs
    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 CloudUserOrgAssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CloudUserOrgAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CloudUserOrgAssignmentArgs
    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 cloudUserOrgAssignmentResource = new Mongodbatlas.CloudUserOrgAssignment("cloudUserOrgAssignmentResource", new()
    {
        OrgId = "string",
        Roles = new Mongodbatlas.Inputs.CloudUserOrgAssignmentRolesArgs
        {
            OrgRoles = new[]
            {
                "string",
            },
            ProjectRoleAssignments = new[]
            {
                new Mongodbatlas.Inputs.CloudUserOrgAssignmentRolesProjectRoleAssignmentArgs
                {
                    ProjectId = "string",
                    ProjectRoles = new[]
                    {
                        "string",
                    },
                },
            },
        },
        Username = "string",
    });
    
    example, err := mongodbatlas.NewCloudUserOrgAssignment(ctx, "cloudUserOrgAssignmentResource", &mongodbatlas.CloudUserOrgAssignmentArgs{
    	OrgId: pulumi.String("string"),
    	Roles: &mongodbatlas.CloudUserOrgAssignmentRolesArgs{
    		OrgRoles: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		ProjectRoleAssignments: mongodbatlas.CloudUserOrgAssignmentRolesProjectRoleAssignmentArray{
    			&mongodbatlas.CloudUserOrgAssignmentRolesProjectRoleAssignmentArgs{
    				ProjectId: pulumi.String("string"),
    				ProjectRoles: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    			},
    		},
    	},
    	Username: pulumi.String("string"),
    })
    
    var cloudUserOrgAssignmentResource = new CloudUserOrgAssignment("cloudUserOrgAssignmentResource", CloudUserOrgAssignmentArgs.builder()
        .orgId("string")
        .roles(CloudUserOrgAssignmentRolesArgs.builder()
            .orgRoles("string")
            .projectRoleAssignments(CloudUserOrgAssignmentRolesProjectRoleAssignmentArgs.builder()
                .projectId("string")
                .projectRoles("string")
                .build())
            .build())
        .username("string")
        .build());
    
    cloud_user_org_assignment_resource = mongodbatlas.CloudUserOrgAssignment("cloudUserOrgAssignmentResource",
        org_id="string",
        roles={
            "org_roles": ["string"],
            "project_role_assignments": [{
                "project_id": "string",
                "project_roles": ["string"],
            }],
        },
        username="string")
    
    const cloudUserOrgAssignmentResource = new mongodbatlas.CloudUserOrgAssignment("cloudUserOrgAssignmentResource", {
        orgId: "string",
        roles: {
            orgRoles: ["string"],
            projectRoleAssignments: [{
                projectId: "string",
                projectRoles: ["string"],
            }],
        },
        username: "string",
    });
    
    type: mongodbatlas:CloudUserOrgAssignment
    properties:
        orgId: string
        roles:
            orgRoles:
                - string
            projectRoleAssignments:
                - projectId: string
                  projectRoles:
                    - string
        username: string
    

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

    OrgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    Roles CloudUserOrgAssignmentRoles
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    Username string
    Email address that represents the username of the MongoDB Cloud user.
    OrgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    Roles CloudUserOrgAssignmentRolesArgs
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    Username string
    Email address that represents the username of the MongoDB Cloud user.
    orgId String
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    roles CloudUserOrgAssignmentRoles
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    username String
    Email address that represents the username of the MongoDB Cloud user.
    orgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    roles CloudUserOrgAssignmentRoles
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    username string
    Email address that represents the username of the MongoDB Cloud user.
    org_id str
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    roles CloudUserOrgAssignmentRolesArgs
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    username str
    Email address that represents the username of the MongoDB Cloud user.
    orgId String
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    roles Property Map
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    username String
    Email address that represents the username of the MongoDB Cloud user.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CloudUserOrgAssignment resource produces the following output properties:

    Country string
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    CreatedAt string
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    FirstName string
    First or given name that belongs to the MongoDB Cloud user.
    Id string
    The provider-assigned unique ID for this managed resource.
    InvitationCreatedAt string
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    InvitationExpiresAt string
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    InviterUsername string
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    LastAuth string
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    LastName string
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    MobileNumber string
    Mobile phone number that belongs to the MongoDB Cloud user.
    OrgMembershipStatus string
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    TeamIds List<string>
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    UserId string
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.
    Country string
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    CreatedAt string
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    FirstName string
    First or given name that belongs to the MongoDB Cloud user.
    Id string
    The provider-assigned unique ID for this managed resource.
    InvitationCreatedAt string
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    InvitationExpiresAt string
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    InviterUsername string
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    LastAuth string
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    LastName string
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    MobileNumber string
    Mobile phone number that belongs to the MongoDB Cloud user.
    OrgMembershipStatus string
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    TeamIds []string
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    UserId string
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.
    country String
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    createdAt String
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    firstName String
    First or given name that belongs to the MongoDB Cloud user.
    id String
    The provider-assigned unique ID for this managed resource.
    invitationCreatedAt String
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    invitationExpiresAt String
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    inviterUsername String
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    lastAuth String
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    lastName String
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    mobileNumber String
    Mobile phone number that belongs to the MongoDB Cloud user.
    orgMembershipStatus String
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    teamIds List<String>
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    userId String
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.
    country string
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    createdAt string
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    firstName string
    First or given name that belongs to the MongoDB Cloud user.
    id string
    The provider-assigned unique ID for this managed resource.
    invitationCreatedAt string
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    invitationExpiresAt string
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    inviterUsername string
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    lastAuth string
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    lastName string
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    mobileNumber string
    Mobile phone number that belongs to the MongoDB Cloud user.
    orgMembershipStatus string
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    teamIds string[]
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    userId string
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.
    country str
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    created_at str
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    first_name str
    First or given name that belongs to the MongoDB Cloud user.
    id str
    The provider-assigned unique ID for this managed resource.
    invitation_created_at str
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    invitation_expires_at str
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    inviter_username str
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    last_auth str
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    last_name str
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    mobile_number str
    Mobile phone number that belongs to the MongoDB Cloud user.
    org_membership_status str
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    team_ids Sequence[str]
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    user_id str
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.
    country String
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    createdAt String
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    firstName String
    First or given name that belongs to the MongoDB Cloud user.
    id String
    The provider-assigned unique ID for this managed resource.
    invitationCreatedAt String
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    invitationExpiresAt String
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    inviterUsername String
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    lastAuth String
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    lastName String
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    mobileNumber String
    Mobile phone number that belongs to the MongoDB Cloud user.
    orgMembershipStatus String
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    teamIds List<String>
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    userId String
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.

    Look up Existing CloudUserOrgAssignment Resource

    Get an existing CloudUserOrgAssignment 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?: CloudUserOrgAssignmentState, opts?: CustomResourceOptions): CloudUserOrgAssignment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            country: Optional[str] = None,
            created_at: Optional[str] = None,
            first_name: Optional[str] = None,
            invitation_created_at: Optional[str] = None,
            invitation_expires_at: Optional[str] = None,
            inviter_username: Optional[str] = None,
            last_auth: Optional[str] = None,
            last_name: Optional[str] = None,
            mobile_number: Optional[str] = None,
            org_id: Optional[str] = None,
            org_membership_status: Optional[str] = None,
            roles: Optional[CloudUserOrgAssignmentRolesArgs] = None,
            team_ids: Optional[Sequence[str]] = None,
            user_id: Optional[str] = None,
            username: Optional[str] = None) -> CloudUserOrgAssignment
    func GetCloudUserOrgAssignment(ctx *Context, name string, id IDInput, state *CloudUserOrgAssignmentState, opts ...ResourceOption) (*CloudUserOrgAssignment, error)
    public static CloudUserOrgAssignment Get(string name, Input<string> id, CloudUserOrgAssignmentState? state, CustomResourceOptions? opts = null)
    public static CloudUserOrgAssignment get(String name, Output<String> id, CloudUserOrgAssignmentState state, CustomResourceOptions options)
    resources:  _:    type: mongodbatlas:CloudUserOrgAssignment    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:
    Country string
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    CreatedAt string
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    FirstName string
    First or given name that belongs to the MongoDB Cloud user.
    InvitationCreatedAt string
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    InvitationExpiresAt string
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    InviterUsername string
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    LastAuth string
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    LastName string
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    MobileNumber string
    Mobile phone number that belongs to the MongoDB Cloud user.
    OrgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    OrgMembershipStatus string
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    Roles CloudUserOrgAssignmentRoles
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    TeamIds List<string>
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    UserId string
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.
    Username string
    Email address that represents the username of the MongoDB Cloud user.
    Country string
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    CreatedAt string
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    FirstName string
    First or given name that belongs to the MongoDB Cloud user.
    InvitationCreatedAt string
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    InvitationExpiresAt string
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    InviterUsername string
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    LastAuth string
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    LastName string
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    MobileNumber string
    Mobile phone number that belongs to the MongoDB Cloud user.
    OrgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    OrgMembershipStatus string
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    Roles CloudUserOrgAssignmentRolesArgs
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    TeamIds []string
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    UserId string
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.
    Username string
    Email address that represents the username of the MongoDB Cloud user.
    country String
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    createdAt String
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    firstName String
    First or given name that belongs to the MongoDB Cloud user.
    invitationCreatedAt String
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    invitationExpiresAt String
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    inviterUsername String
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    lastAuth String
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    lastName String
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    mobileNumber String
    Mobile phone number that belongs to the MongoDB Cloud user.
    orgId String
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    orgMembershipStatus String
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    roles CloudUserOrgAssignmentRoles
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    teamIds List<String>
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    userId String
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.
    username String
    Email address that represents the username of the MongoDB Cloud user.
    country string
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    createdAt string
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    firstName string
    First or given name that belongs to the MongoDB Cloud user.
    invitationCreatedAt string
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    invitationExpiresAt string
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    inviterUsername string
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    lastAuth string
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    lastName string
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    mobileNumber string
    Mobile phone number that belongs to the MongoDB Cloud user.
    orgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    orgMembershipStatus string
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    roles CloudUserOrgAssignmentRoles
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    teamIds string[]
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    userId string
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.
    username string
    Email address that represents the username of the MongoDB Cloud user.
    country str
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    created_at str
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    first_name str
    First or given name that belongs to the MongoDB Cloud user.
    invitation_created_at str
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    invitation_expires_at str
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    inviter_username str
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    last_auth str
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    last_name str
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    mobile_number str
    Mobile phone number that belongs to the MongoDB Cloud user.
    org_id str
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    org_membership_status str
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    roles CloudUserOrgAssignmentRolesArgs
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    team_ids Sequence[str]
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    user_id str
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.
    username str
    Email address that represents the username of the MongoDB Cloud user.
    country String
    Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
    createdAt String
    Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
    firstName String
    First or given name that belongs to the MongoDB Cloud user.
    invitationCreatedAt String
    Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    invitationExpiresAt String
    Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
    inviterUsername String
    Username of the MongoDB Cloud user who sent the invitation to join the organization.
    lastAuth String
    Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
    lastName String
    Last name, family name, or surname that belongs to the MongoDB Cloud user.
    mobileNumber String
    Mobile phone number that belongs to the MongoDB Cloud user.
    orgId String
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
    orgMembershipStatus String
    String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.
    roles Property Map
    Organization and project level roles to assign the MongoDB Cloud user within one organization.
    teamIds List<String>
    List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
    userId String
    Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.
    username String
    Email address that represents the username of the MongoDB Cloud user.

    Supporting Types

    CloudUserOrgAssignmentRoles, CloudUserOrgAssignmentRolesArgs

    OrgRoles List<string>
    One or more organization level roles to assign the MongoDB Cloud user.
    ProjectRoleAssignments List<CloudUserOrgAssignmentRolesProjectRoleAssignment>
    List of project level role assignments to assign the MongoDB Cloud user.
    OrgRoles []string
    One or more organization level roles to assign the MongoDB Cloud user.
    ProjectRoleAssignments []CloudUserOrgAssignmentRolesProjectRoleAssignment
    List of project level role assignments to assign the MongoDB Cloud user.
    orgRoles List<String>
    One or more organization level roles to assign the MongoDB Cloud user.
    projectRoleAssignments List<CloudUserOrgAssignmentRolesProjectRoleAssignment>
    List of project level role assignments to assign the MongoDB Cloud user.
    orgRoles string[]
    One or more organization level roles to assign the MongoDB Cloud user.
    projectRoleAssignments CloudUserOrgAssignmentRolesProjectRoleAssignment[]
    List of project level role assignments to assign the MongoDB Cloud user.
    org_roles Sequence[str]
    One or more organization level roles to assign the MongoDB Cloud user.
    project_role_assignments Sequence[CloudUserOrgAssignmentRolesProjectRoleAssignment]
    List of project level role assignments to assign the MongoDB Cloud user.
    orgRoles List<String>
    One or more organization level roles to assign the MongoDB Cloud user.
    projectRoleAssignments List<Property Map>
    List of project level role assignments to assign the MongoDB Cloud user.

    CloudUserOrgAssignmentRolesProjectRoleAssignment, CloudUserOrgAssignmentRolesProjectRoleAssignmentArgs

    ProjectId string
    Unique 24-hexadecimal digit string that identifies the project to which these roles belong.
    ProjectRoles List<string>
    One or more project-level roles assigned to the MongoDB Cloud user.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies the project to which these roles belong.
    ProjectRoles []string
    One or more project-level roles assigned to the MongoDB Cloud user.
    projectId String
    Unique 24-hexadecimal digit string that identifies the project to which these roles belong.
    projectRoles List<String>
    One or more project-level roles assigned to the MongoDB Cloud user.
    projectId string
    Unique 24-hexadecimal digit string that identifies the project to which these roles belong.
    projectRoles string[]
    One or more project-level roles assigned to the MongoDB Cloud user.
    project_id str
    Unique 24-hexadecimal digit string that identifies the project to which these roles belong.
    project_roles Sequence[str]
    One or more project-level roles assigned to the MongoDB Cloud user.
    projectId String
    Unique 24-hexadecimal digit string that identifies the project to which these roles belong.
    projectRoles List<String>
    One or more project-level roles assigned to the MongoDB Cloud user.

    Import

    Cloud User Org Assignment resource can be imported using the Org ID & Username OR Org ID & User ID, in the format ORG_ID/USERNAME OR ORG_ID/USER_ID.

    $ pulumi import mongodbatlas:index/cloudUserOrgAssignment:CloudUserOrgAssignment test 63cfbf302333a3011d98592e/test-user@example.com
    

    OR

    $ pulumi import mongodbatlas:index/cloudUserOrgAssignment:CloudUserOrgAssignment test 63cfbf302333a3011d98592e/5f18367ccb7a503a2b481b7a
    

    For more information see: MongoDB Atlas API - Cloud Users Documentation.

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

    Package Details

    Repository
    MongoDB Atlas pulumi/pulumi-mongodbatlas
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mongodbatlas Terraform Provider.
    mongodbatlas logo
    MongoDB Atlas v4.0.0 published on Tuesday, Dec 30, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate