1. Packages
  2. Mongodbatlas Provider
  3. API Docs
  4. getAtlasUser
MongoDB Atlas v3.30.0 published on Friday, Mar 21, 2025 by Pulumi

mongodbatlas.getAtlasUser

Explore with Pulumi AI

# Data Source: mongodbatlas.getAtlasUser

mongodbatlas.getAtlasUser Provides a MongoDB Atlas User.

NOTE: If you are the owner of a MongoDB Atlas organization or project, you can also retrieve the user profile for any user with membership in that organization or project.

Example Usage

Using user_id attribute to query

import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = mongodbatlas.getAtlasUser({
    userId: "<USER_ID>",
});
Copy
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.get_atlas_user(user_id="<USER_ID>")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := mongodbatlas.GetAtlasUser(ctx, &mongodbatlas.GetAtlasUserArgs{
			UserId: pulumi.StringRef("<USER_ID>"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var test = Mongodbatlas.GetAtlasUser.Invoke(new()
    {
        UserId = "<USER_ID>",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.MongodbatlasFunctions;
import com.pulumi.mongodbatlas.inputs.GetAtlasUserArgs;
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) {
        final var test = MongodbatlasFunctions.getAtlasUser(GetAtlasUserArgs.builder()
            .userId("<USER_ID>")
            .build());

    }
}
Copy
variables:
  test:
    fn::invoke:
      function: mongodbatlas:getAtlasUser
      arguments:
        userId: <USER_ID>
Copy

Using username attribute to query

import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = mongodbatlas.getAtlasUser({
    username: "<USERNAME>",
});
Copy
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.get_atlas_user(username="<USERNAME>")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := mongodbatlas.GetAtlasUser(ctx, &mongodbatlas.GetAtlasUserArgs{
			Username: pulumi.StringRef("<USERNAME>"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var test = Mongodbatlas.GetAtlasUser.Invoke(new()
    {
        Username = "<USERNAME>",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.MongodbatlasFunctions;
import com.pulumi.mongodbatlas.inputs.GetAtlasUserArgs;
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) {
        final var test = MongodbatlasFunctions.getAtlasUser(GetAtlasUserArgs.builder()
            .username("<USERNAME>")
            .build());

    }
}
Copy
variables:
  test:
    fn::invoke:
      function: mongodbatlas:getAtlasUser
      arguments:
        username: <USERNAME>
Copy

Using getAtlasUser

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 getAtlasUser(args: GetAtlasUserArgs, opts?: InvokeOptions): Promise<GetAtlasUserResult>
function getAtlasUserOutput(args: GetAtlasUserOutputArgs, opts?: InvokeOptions): Output<GetAtlasUserResult>
Copy
def get_atlas_user(user_id: Optional[str] = None,
                   username: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetAtlasUserResult
def get_atlas_user_output(user_id: Optional[pulumi.Input[str]] = None,
                   username: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetAtlasUserResult]
Copy
func GetAtlasUser(ctx *Context, args *GetAtlasUserArgs, opts ...InvokeOption) (*GetAtlasUserResult, error)
func GetAtlasUserOutput(ctx *Context, args *GetAtlasUserOutputArgs, opts ...InvokeOption) GetAtlasUserResultOutput
Copy

> Note: This function is named GetAtlasUser in the Go SDK.

public static class GetAtlasUser 
{
    public static Task<GetAtlasUserResult> InvokeAsync(GetAtlasUserArgs args, InvokeOptions? opts = null)
    public static Output<GetAtlasUserResult> Invoke(GetAtlasUserInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAtlasUserResult> getAtlasUser(GetAtlasUserArgs args, InvokeOptions options)
public static Output<GetAtlasUserResult> getAtlasUser(GetAtlasUserArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: mongodbatlas:index/getAtlasUser:getAtlasUser
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

UserId string
Unique 24-hexadecimal digit string that identifies this user.
Username string

Email address that belongs to the MongoDB Atlas user account. You can't modify this address after creating the user.

IMPORTANT: Either user_id or username must be configurated.

UserId string
Unique 24-hexadecimal digit string that identifies this user.
Username string

Email address that belongs to the MongoDB Atlas user account. You can't modify this address after creating the user.

IMPORTANT: Either user_id or username must be configurated.

userId String
Unique 24-hexadecimal digit string that identifies this user.
username String

Email address that belongs to the MongoDB Atlas user account. You can't modify this address after creating the user.

IMPORTANT: Either user_id or username must be configurated.

userId string
Unique 24-hexadecimal digit string that identifies this user.
username string

Email address that belongs to the MongoDB Atlas user account. You can't modify this address after creating the user.

IMPORTANT: Either user_id or username must be configurated.

user_id str
Unique 24-hexadecimal digit string that identifies this user.
username str

Email address that belongs to the MongoDB Atlas user account. You can't modify this address after creating the user.

IMPORTANT: Either user_id or username must be configurated.

userId String
Unique 24-hexadecimal digit string that identifies this user.
username String

Email address that belongs to the MongoDB Atlas user account. You can't modify this address after creating the user.

IMPORTANT: Either user_id or username must be configurated.

getAtlasUser Result

The following output properties are available:

Country string
Two alphabet characters that identifies MongoDB Atlas user's geographic location. This parameter uses the ISO 3166-1a2 code format.
CreatedAt string
Date and time when the current account is created. This value is in the ISO 8601 timestamp format in UTC.
EmailAddress string
Email address that belongs to the MongoDB Atlas user.
FirstName string
First or given name that belongs to the MongoDB Atlas user.
Id string

Deprecated: Please use user_id id attribute instead

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 Atlas user.
Links List<GetAtlasUserLink>
MobileNumber string
Mobile phone number that belongs to the MongoDB Atlas user.
Roles List<GetAtlasUserRole>
TeamIds List<string>
List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Atlas user belongs.

  • links.#.href - Uniform Resource Locator (URL) that points another API resource to which this response has some relationship. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • links.#.rel - Uniform Resource Locator (URL) that defines the semantic relationship between this resource and another API resource. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • roles.#.group_id - Unique 24-hexadecimal digit string that identifies the project to which this role belongs. You can set a value for this parameter or orgId but not both in the same request.
  • roles.#.org_id - Unique 24-hexadecimal digit string that identifies the organization to which this role belongs. You can set a value for this parameter or groupId but not both in the same request.
  • roles.#.role_name - Human-readable label that identifies the collection of privileges that MongoDB Atlas grants a specific API key, user, or team. These roles include organization- and project-level roles. The MongoDB Documentation describes the valid roles that can be assigned.
UserId string
Username string
Country string
Two alphabet characters that identifies MongoDB Atlas user's geographic location. This parameter uses the ISO 3166-1a2 code format.
CreatedAt string
Date and time when the current account is created. This value is in the ISO 8601 timestamp format in UTC.
EmailAddress string
Email address that belongs to the MongoDB Atlas user.
FirstName string
First or given name that belongs to the MongoDB Atlas user.
Id string

Deprecated: Please use user_id id attribute instead

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 Atlas user.
Links []GetAtlasUserLink
MobileNumber string
Mobile phone number that belongs to the MongoDB Atlas user.
Roles []GetAtlasUserRole
TeamIds []string
List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Atlas user belongs.

  • links.#.href - Uniform Resource Locator (URL) that points another API resource to which this response has some relationship. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • links.#.rel - Uniform Resource Locator (URL) that defines the semantic relationship between this resource and another API resource. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • roles.#.group_id - Unique 24-hexadecimal digit string that identifies the project to which this role belongs. You can set a value for this parameter or orgId but not both in the same request.
  • roles.#.org_id - Unique 24-hexadecimal digit string that identifies the organization to which this role belongs. You can set a value for this parameter or groupId but not both in the same request.
  • roles.#.role_name - Human-readable label that identifies the collection of privileges that MongoDB Atlas grants a specific API key, user, or team. These roles include organization- and project-level roles. The MongoDB Documentation describes the valid roles that can be assigned.
UserId string
Username string
country String
Two alphabet characters that identifies MongoDB Atlas user's geographic location. This parameter uses the ISO 3166-1a2 code format.
createdAt String
Date and time when the current account is created. This value is in the ISO 8601 timestamp format in UTC.
emailAddress String
Email address that belongs to the MongoDB Atlas user.
firstName String
First or given name that belongs to the MongoDB Atlas user.
id String

Deprecated: Please use user_id id attribute instead

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 Atlas user.
links List<GetAtlasUserLink>
mobileNumber String
Mobile phone number that belongs to the MongoDB Atlas user.
roles List<GetAtlasUserRole>
teamIds List<String>
List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Atlas user belongs.

  • links.#.href - Uniform Resource Locator (URL) that points another API resource to which this response has some relationship. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • links.#.rel - Uniform Resource Locator (URL) that defines the semantic relationship between this resource and another API resource. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • roles.#.group_id - Unique 24-hexadecimal digit string that identifies the project to which this role belongs. You can set a value for this parameter or orgId but not both in the same request.
  • roles.#.org_id - Unique 24-hexadecimal digit string that identifies the organization to which this role belongs. You can set a value for this parameter or groupId but not both in the same request.
  • roles.#.role_name - Human-readable label that identifies the collection of privileges that MongoDB Atlas grants a specific API key, user, or team. These roles include organization- and project-level roles. The MongoDB Documentation describes the valid roles that can be assigned.
userId String
username String
country string
Two alphabet characters that identifies MongoDB Atlas user's geographic location. This parameter uses the ISO 3166-1a2 code format.
createdAt string
Date and time when the current account is created. This value is in the ISO 8601 timestamp format in UTC.
emailAddress string
Email address that belongs to the MongoDB Atlas user.
firstName string
First or given name that belongs to the MongoDB Atlas user.
id string

Deprecated: Please use user_id id attribute instead

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 Atlas user.
links GetAtlasUserLink[]
mobileNumber string
Mobile phone number that belongs to the MongoDB Atlas user.
roles GetAtlasUserRole[]
teamIds string[]
List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Atlas user belongs.

  • links.#.href - Uniform Resource Locator (URL) that points another API resource to which this response has some relationship. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • links.#.rel - Uniform Resource Locator (URL) that defines the semantic relationship between this resource and another API resource. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • roles.#.group_id - Unique 24-hexadecimal digit string that identifies the project to which this role belongs. You can set a value for this parameter or orgId but not both in the same request.
  • roles.#.org_id - Unique 24-hexadecimal digit string that identifies the organization to which this role belongs. You can set a value for this parameter or groupId but not both in the same request.
  • roles.#.role_name - Human-readable label that identifies the collection of privileges that MongoDB Atlas grants a specific API key, user, or team. These roles include organization- and project-level roles. The MongoDB Documentation describes the valid roles that can be assigned.
userId string
username string
country str
Two alphabet characters that identifies MongoDB Atlas user's geographic location. This parameter uses the ISO 3166-1a2 code format.
created_at str
Date and time when the current account is created. This value is in the ISO 8601 timestamp format in UTC.
email_address str
Email address that belongs to the MongoDB Atlas user.
first_name str
First or given name that belongs to the MongoDB Atlas user.
id str

Deprecated: Please use user_id id attribute instead

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 Atlas user.
links Sequence[GetAtlasUserLink]
mobile_number str
Mobile phone number that belongs to the MongoDB Atlas user.
roles Sequence[GetAtlasUserRole]
team_ids Sequence[str]
List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Atlas user belongs.

  • links.#.href - Uniform Resource Locator (URL) that points another API resource to which this response has some relationship. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • links.#.rel - Uniform Resource Locator (URL) that defines the semantic relationship between this resource and another API resource. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • roles.#.group_id - Unique 24-hexadecimal digit string that identifies the project to which this role belongs. You can set a value for this parameter or orgId but not both in the same request.
  • roles.#.org_id - Unique 24-hexadecimal digit string that identifies the organization to which this role belongs. You can set a value for this parameter or groupId but not both in the same request.
  • roles.#.role_name - Human-readable label that identifies the collection of privileges that MongoDB Atlas grants a specific API key, user, or team. These roles include organization- and project-level roles. The MongoDB Documentation describes the valid roles that can be assigned.
user_id str
username str
country String
Two alphabet characters that identifies MongoDB Atlas user's geographic location. This parameter uses the ISO 3166-1a2 code format.
createdAt String
Date and time when the current account is created. This value is in the ISO 8601 timestamp format in UTC.
emailAddress String
Email address that belongs to the MongoDB Atlas user.
firstName String
First or given name that belongs to the MongoDB Atlas user.
id String

Deprecated: Please use user_id id attribute instead

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 Atlas user.
links List<Property Map>
mobileNumber String
Mobile phone number that belongs to the MongoDB Atlas user.
roles List<Property Map>
teamIds List<String>
List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Atlas user belongs.

  • links.#.href - Uniform Resource Locator (URL) that points another API resource to which this response has some relationship. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • links.#.rel - Uniform Resource Locator (URL) that defines the semantic relationship between this resource and another API resource. This URL often begins with https://cloud.mongodb.com/api/atlas.
  • roles.#.group_id - Unique 24-hexadecimal digit string that identifies the project to which this role belongs. You can set a value for this parameter or orgId but not both in the same request.
  • roles.#.org_id - Unique 24-hexadecimal digit string that identifies the organization to which this role belongs. You can set a value for this parameter or groupId but not both in the same request.
  • roles.#.role_name - Human-readable label that identifies the collection of privileges that MongoDB Atlas grants a specific API key, user, or team. These roles include organization- and project-level roles. The MongoDB Documentation describes the valid roles that can be assigned.
userId String
username String

Supporting Types

Href This property is required. string
Rel This property is required. string
Href This property is required. string
Rel This property is required. string
href This property is required. String
rel This property is required. String
href This property is required. string
rel This property is required. string
href This property is required. str
rel This property is required. str
href This property is required. String
rel This property is required. String

GetAtlasUserRole

GroupId This property is required. string
OrgId This property is required. string
RoleName This property is required. string
GroupId This property is required. string
OrgId This property is required. string
RoleName This property is required. string
groupId This property is required. String
orgId This property is required. String
roleName This property is required. String
groupId This property is required. string
orgId This property is required. string
roleName This property is required. string
group_id This property is required. str
org_id This property is required. str
role_name This property is required. str
groupId This property is required. String
orgId This property is required. String
roleName This property is required. String

Package Details

Repository
MongoDB Atlas pulumi/pulumi-mongodbatlas
License
Apache-2.0
Notes
This Pulumi package is based on the mongodbatlas Terraform Provider.