mongodbatlas.CloudUserOrgAssignment provides a Cloud User Organization Assignment data source. The data source lets you retrieve a user assigned 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 are not returned 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}
Using getCloudUserOrgAssignment
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCloudUserOrgAssignment(args: GetCloudUserOrgAssignmentArgs, opts?: InvokeOptions): Promise<GetCloudUserOrgAssignmentResult>
function getCloudUserOrgAssignmentOutput(args: GetCloudUserOrgAssignmentOutputArgs, opts?: InvokeOptions): Output<GetCloudUserOrgAssignmentResult>def get_cloud_user_org_assignment(org_id: Optional[str] = None,
user_id: Optional[str] = None,
username: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCloudUserOrgAssignmentResult
def get_cloud_user_org_assignment_output(org_id: Optional[pulumi.Input[str]] = None,
user_id: Optional[pulumi.Input[str]] = None,
username: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetCloudUserOrgAssignmentResult]func LookupCloudUserOrgAssignment(ctx *Context, args *LookupCloudUserOrgAssignmentArgs, opts ...InvokeOption) (*LookupCloudUserOrgAssignmentResult, error)
func LookupCloudUserOrgAssignmentOutput(ctx *Context, args *LookupCloudUserOrgAssignmentOutputArgs, opts ...InvokeOption) LookupCloudUserOrgAssignmentResultOutput> Note: This function is named LookupCloudUserOrgAssignment in the Go SDK.
public static class GetCloudUserOrgAssignment
{
public static Task<GetCloudUserOrgAssignmentResult> InvokeAsync(GetCloudUserOrgAssignmentArgs args, InvokeOptions? opts = null)
public static Output<GetCloudUserOrgAssignmentResult> Invoke(GetCloudUserOrgAssignmentInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetCloudUserOrgAssignmentResult> getCloudUserOrgAssignment(GetCloudUserOrgAssignmentArgs args, InvokeOptions options)
public static Output<GetCloudUserOrgAssignmentResult> getCloudUserOrgAssignment(GetCloudUserOrgAssignmentArgs args, InvokeOptions options)
fn::invoke:
function: mongodbatlas:index/getCloudUserOrgAssignment:getCloudUserOrgAssignment
arguments:
# arguments dictionaryThe following arguments are supported:
- Org
Id 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.
- User
Id 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.
- Org
Id 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.
- User
Id 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.
- org
Id 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.
- user
Id 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.
- org
Id 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.
- user
Id 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.
- 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.
- 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.
- org
Id 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.
- user
Id 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.
getCloudUserOrgAssignment Result
The following output properties are available:
- Country string
- Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
- Created
At string - Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
- First
Name string - First or given name that belongs to the MongoDB Cloud user.
- Id string
- The provider-assigned unique ID for this managed resource.
- Invitation
Created stringAt - Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
- Invitation
Expires stringAt - Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
- Inviter
Username string - Username of the MongoDB Cloud user who sent the invitation to join the organization.
- Last
Auth string - Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
- Last
Name string - Last name, family name, or surname that belongs to the MongoDB Cloud user.
- Mobile
Number string - Mobile phone number that belongs to the MongoDB Cloud user.
- Org
Id 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.
- Org
Membership stringStatus - 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
Get
Cloud User Org Assignment Roles - Organization and project level roles to assign the MongoDB Cloud user within one organization.
- Team
Ids List<string> - List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
- User
Id 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.
- Created
At string - Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
- First
Name string - First or given name that belongs to the MongoDB Cloud user.
- Id string
- The provider-assigned unique ID for this managed resource.
- Invitation
Created stringAt - Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
- Invitation
Expires stringAt - Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
- Inviter
Username string - Username of the MongoDB Cloud user who sent the invitation to join the organization.
- Last
Auth string - Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
- Last
Name string - Last name, family name, or surname that belongs to the MongoDB Cloud user.
- Mobile
Number string - Mobile phone number that belongs to the MongoDB Cloud user.
- Org
Id 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.
- Org
Membership stringStatus - 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
Get
Cloud User Org Assignment Roles - Organization and project level roles to assign the MongoDB Cloud user within one organization.
- Team
Ids []string - List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
- User
Id 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.
- created
At String - Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
- first
Name String - First or given name that belongs to the MongoDB Cloud user.
- id String
- The provider-assigned unique ID for this managed resource.
- invitation
Created StringAt - Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
- invitation
Expires StringAt - Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
- inviter
Username String - Username of the MongoDB Cloud user who sent the invitation to join the organization.
- last
Auth String - Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
- last
Name String - Last name, family name, or surname that belongs to the MongoDB Cloud user.
- mobile
Number String - Mobile phone number that belongs to the MongoDB Cloud user.
- org
Id 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.
- org
Membership StringStatus - 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
Get
Cloud User Org Assignment Roles - Organization and project level roles to assign the MongoDB Cloud user within one organization.
- team
Ids List<String> - List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
- user
Id 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.
- created
At string - Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
- first
Name string - First or given name that belongs to the MongoDB Cloud user.
- id string
- The provider-assigned unique ID for this managed resource.
- invitation
Created stringAt - Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
- invitation
Expires stringAt - Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
- inviter
Username string - Username of the MongoDB Cloud user who sent the invitation to join the organization.
- last
Auth string - Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
- last
Name string - Last name, family name, or surname that belongs to the MongoDB Cloud user.
- mobile
Number string - Mobile phone number that belongs to the MongoDB Cloud user.
- org
Id 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.
- org
Membership stringStatus - 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
Get
Cloud User Org Assignment Roles - Organization and project level roles to assign the MongoDB Cloud user within one organization.
- team
Ids string[] - List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
- user
Id 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.
- id str
- The provider-assigned unique ID for this managed resource.
- invitation_
created_ strat - Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
- invitation_
expires_ strat - 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_ strstatus - 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
Get
Cloud User Org Assignment Roles - 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.
- created
At String - Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.
- first
Name String - First or given name that belongs to the MongoDB Cloud user.
- id String
- The provider-assigned unique ID for this managed resource.
- invitation
Created StringAt - Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
- invitation
Expires StringAt - Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.
- inviter
Username String - Username of the MongoDB Cloud user who sent the invitation to join the organization.
- last
Auth String - Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.
- last
Name String - Last name, family name, or surname that belongs to the MongoDB Cloud user.
- mobile
Number String - Mobile phone number that belongs to the MongoDB Cloud user.
- org
Id 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.
- org
Membership StringStatus - 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.
- team
Ids List<String> - List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.
- user
Id 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
GetCloudUserOrgAssignmentRoles
- Org
Roles List<string> - One or more organization level roles to assign the MongoDB Cloud user.
- Project
Role List<GetAssignments Cloud User Org Assignment Roles Project Role Assignment> - List of project level role assignments to assign the MongoDB Cloud user.
- Org
Roles []string - One or more organization level roles to assign the MongoDB Cloud user.
- Project
Role []GetAssignments Cloud User Org Assignment Roles Project Role Assignment - List of project level role assignments to assign the MongoDB Cloud user.
- org
Roles List<String> - One or more organization level roles to assign the MongoDB Cloud user.
- project
Role List<GetAssignments Cloud User Org Assignment Roles Project Role Assignment> - List of project level role assignments to assign the MongoDB Cloud user.
- org
Roles string[] - One or more organization level roles to assign the MongoDB Cloud user.
- project
Role GetAssignments Cloud User Org Assignment Roles Project Role Assignment[] - 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_ Sequence[Getassignments Cloud User Org Assignment Roles Project Role Assignment] - List of project level role assignments to assign the MongoDB Cloud user.
- org
Roles List<String> - One or more organization level roles to assign the MongoDB Cloud user.
- project
Role List<Property Map>Assignments - List of project level role assignments to assign the MongoDB Cloud user.
GetCloudUserOrgAssignmentRolesProjectRoleAssignment
- Project
Id string - Unique 24-hexadecimal digit string that identifies the project to which these roles belong.
- Project
Roles List<string> - One or more project-level roles assigned to the MongoDB Cloud user.
- Project
Id string - Unique 24-hexadecimal digit string that identifies the project to which these roles belong.
- Project
Roles []string - One or more project-level roles assigned to the MongoDB Cloud user.
- project
Id String - Unique 24-hexadecimal digit string that identifies the project to which these roles belong.
- project
Roles List<String> - One or more project-level roles assigned to the MongoDB Cloud user.
- project
Id string - Unique 24-hexadecimal digit string that identifies the project to which these roles belong.
- project
Roles 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.
- project
Id String - Unique 24-hexadecimal digit string that identifies the project to which these roles belong.
- project
Roles List<String> - One or more project-level roles assigned to the MongoDB Cloud user.
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlasTerraform Provider.
