mongodbatlas.getDatabaseUser
Explore with Pulumi AI
mongodbatlas.DatabaseUser
describe a Database User. This represents a database user which will be applied to all clusters within the project.
Each user has a set of roles that provide access to the project’s databases. User’s roles apply to all the clusters in the project: if two clusters have a products
database and a user has a role granting read
access on the products database, the user has that access on both clusters.
NOTE: Groups and projects are synonymous terms. You may find group_id in the official documentation.
Using getDatabaseUser
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 getDatabaseUser(args: GetDatabaseUserArgs, opts?: InvokeOptions): Promise<GetDatabaseUserResult>
function getDatabaseUserOutput(args: GetDatabaseUserOutputArgs, opts?: InvokeOptions): Output<GetDatabaseUserResult>
def get_database_user(auth_database_name: Optional[str] = None,
database_name: Optional[str] = None,
project_id: Optional[str] = None,
username: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDatabaseUserResult
def get_database_user_output(auth_database_name: Optional[pulumi.Input[str]] = None,
database_name: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[str]] = None,
username: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseUserResult]
func LookupDatabaseUser(ctx *Context, args *LookupDatabaseUserArgs, opts ...InvokeOption) (*LookupDatabaseUserResult, error)
func LookupDatabaseUserOutput(ctx *Context, args *LookupDatabaseUserOutputArgs, opts ...InvokeOption) LookupDatabaseUserResultOutput
> Note: This function is named LookupDatabaseUser
in the Go SDK.
public static class GetDatabaseUser
{
public static Task<GetDatabaseUserResult> InvokeAsync(GetDatabaseUserArgs args, InvokeOptions? opts = null)
public static Output<GetDatabaseUserResult> Invoke(GetDatabaseUserInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDatabaseUserResult> getDatabaseUser(GetDatabaseUserArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: mongodbatlas:index/getDatabaseUser:getDatabaseUser
arguments:
# arguments dictionary
The following arguments are supported:
- Project
Id string The unique ID for the project to create the database user.
- Username string
Username for authenticating to MongoDB.
- Auth
Database stringName The user’s authentication database. A user must provide both a username and authentication database to log into MongoDB. In Atlas deployments of MongoDB, the authentication database is almost always the admin database, for X509 it is $external.
- Database
Name string Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
- Project
Id string The unique ID for the project to create the database user.
- Username string
Username for authenticating to MongoDB.
- Auth
Database stringName The user’s authentication database. A user must provide both a username and authentication database to log into MongoDB. In Atlas deployments of MongoDB, the authentication database is almost always the admin database, for X509 it is $external.
- Database
Name string Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
- project
Id String The unique ID for the project to create the database user.
- username String
Username for authenticating to MongoDB.
- auth
Database StringName The user’s authentication database. A user must provide both a username and authentication database to log into MongoDB. In Atlas deployments of MongoDB, the authentication database is almost always the admin database, for X509 it is $external.
- database
Name String Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
- project
Id string The unique ID for the project to create the database user.
- username string
Username for authenticating to MongoDB.
- auth
Database stringName The user’s authentication database. A user must provide both a username and authentication database to log into MongoDB. In Atlas deployments of MongoDB, the authentication database is almost always the admin database, for X509 it is $external.
- database
Name string Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
- project_
id str The unique ID for the project to create the database user.
- username str
Username for authenticating to MongoDB.
- auth_
database_ strname The user’s authentication database. A user must provide both a username and authentication database to log into MongoDB. In Atlas deployments of MongoDB, the authentication database is almost always the admin database, for X509 it is $external.
- database_
name str Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
- project
Id String The unique ID for the project to create the database user.
- username String
Username for authenticating to MongoDB.
- auth
Database StringName The user’s authentication database. A user must provide both a username and authentication database to log into MongoDB. In Atlas deployments of MongoDB, the authentication database is almost always the admin database, for X509 it is $external.
- database
Name String Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
getDatabaseUser Result
The following output properties are available:
- Aws
Iam stringType The new database user authenticates with AWS IAM credentials. Default is
NONE
,USER
means user has AWS IAM user credentials,ROLE
- means user has credentials associated with an AWS IAM role.- Id string
The provider-assigned unique ID for this managed resource.
- Labels
List<Get
Database User Label> - Ldap
Auth stringType Method by which the provided username is authenticated. Default is
NONE
. Other valid values are:USER
,GROUP
.- Project
Id string - Roles
List<Get
Database User Role> List of user’s roles and the databases / collections on which the roles apply. A role allows the user to perform particular actions on the specified database. A role on the admin database can include privileges that apply to the other databases as well. See Roles below for more details.
- Scopes
List<Get
Database User Scope> Array of clusters and Atlas Data Lakes that this user has access to.
- Username string
- X509Type string
X.509 method by which the provided username is authenticated.
- Auth
Database stringName - Database
Name string Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
- Aws
Iam stringType The new database user authenticates with AWS IAM credentials. Default is
NONE
,USER
means user has AWS IAM user credentials,ROLE
- means user has credentials associated with an AWS IAM role.- Id string
The provider-assigned unique ID for this managed resource.
- Labels
[]Get
Database User Label - Ldap
Auth stringType Method by which the provided username is authenticated. Default is
NONE
. Other valid values are:USER
,GROUP
.- Project
Id string - Roles
[]Get
Database User Role List of user’s roles and the databases / collections on which the roles apply. A role allows the user to perform particular actions on the specified database. A role on the admin database can include privileges that apply to the other databases as well. See Roles below for more details.
- Scopes
[]Get
Database User Scope Array of clusters and Atlas Data Lakes that this user has access to.
- Username string
- X509Type string
X.509 method by which the provided username is authenticated.
- Auth
Database stringName - Database
Name string Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
- aws
Iam StringType The new database user authenticates with AWS IAM credentials. Default is
NONE
,USER
means user has AWS IAM user credentials,ROLE
- means user has credentials associated with an AWS IAM role.- id String
The provider-assigned unique ID for this managed resource.
- labels
List<Get
Database User Label> - ldap
Auth StringType Method by which the provided username is authenticated. Default is
NONE
. Other valid values are:USER
,GROUP
.- project
Id String - roles
List<Get
Database User Role> List of user’s roles and the databases / collections on which the roles apply. A role allows the user to perform particular actions on the specified database. A role on the admin database can include privileges that apply to the other databases as well. See Roles below for more details.
- scopes
List<Get
Database User Scope> Array of clusters and Atlas Data Lakes that this user has access to.
- username String
- x509Type String
X.509 method by which the provided username is authenticated.
- auth
Database StringName - database
Name String Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
- aws
Iam stringType The new database user authenticates with AWS IAM credentials. Default is
NONE
,USER
means user has AWS IAM user credentials,ROLE
- means user has credentials associated with an AWS IAM role.- id string
The provider-assigned unique ID for this managed resource.
- labels
Get
Database User Label[] - ldap
Auth stringType Method by which the provided username is authenticated. Default is
NONE
. Other valid values are:USER
,GROUP
.- project
Id string - roles
Get
Database User Role[] List of user’s roles and the databases / collections on which the roles apply. A role allows the user to perform particular actions on the specified database. A role on the admin database can include privileges that apply to the other databases as well. See Roles below for more details.
- scopes
Get
Database User Scope[] Array of clusters and Atlas Data Lakes that this user has access to.
- username string
- x509Type string
X.509 method by which the provided username is authenticated.
- auth
Database stringName - database
Name string Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
- aws_
iam_ strtype The new database user authenticates with AWS IAM credentials. Default is
NONE
,USER
means user has AWS IAM user credentials,ROLE
- means user has credentials associated with an AWS IAM role.- id str
The provider-assigned unique ID for this managed resource.
- labels
Sequence[Get
Database User Label] - ldap_
auth_ strtype Method by which the provided username is authenticated. Default is
NONE
. Other valid values are:USER
,GROUP
.- project_
id str - roles
Sequence[Get
Database User Role] List of user’s roles and the databases / collections on which the roles apply. A role allows the user to perform particular actions on the specified database. A role on the admin database can include privileges that apply to the other databases as well. See Roles below for more details.
- scopes
Sequence[Get
Database User Scope] Array of clusters and Atlas Data Lakes that this user has access to.
- username str
- x509_
type str X.509 method by which the provided username is authenticated.
- auth_
database_ strname - database_
name str Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
- aws
Iam StringType The new database user authenticates with AWS IAM credentials. Default is
NONE
,USER
means user has AWS IAM user credentials,ROLE
- means user has credentials associated with an AWS IAM role.- id String
The provider-assigned unique ID for this managed resource.
- labels List<Property Map>
- ldap
Auth StringType Method by which the provided username is authenticated. Default is
NONE
. Other valid values are:USER
,GROUP
.- project
Id String - roles List<Property Map>
List of user’s roles and the databases / collections on which the roles apply. A role allows the user to perform particular actions on the specified database. A role on the admin database can include privileges that apply to the other databases as well. See Roles below for more details.
- scopes List<Property Map>
Array of clusters and Atlas Data Lakes that this user has access to.
- username String
- x509Type String
X.509 method by which the provided username is authenticated.
- auth
Database StringName - database
Name String Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.use auth_database_name instead
Supporting Types
GetDatabaseUserLabel
GetDatabaseUserRole
- Collection
Name string Collection for which the role applies. You can specify a collection for the
read
andreadWrite
roles. If you do not specify a collection forread
andreadWrite
, the role applies to all collections in the database (excluding some collections in thesystem
. database).- Database
Name string Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.- Role
Name string
- Collection
Name string Collection for which the role applies. You can specify a collection for the
read
andreadWrite
roles. If you do not specify a collection forread
andreadWrite
, the role applies to all collections in the database (excluding some collections in thesystem
. database).- Database
Name string Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.- Role
Name string
- collection
Name String Collection for which the role applies. You can specify a collection for the
read
andreadWrite
roles. If you do not specify a collection forread
andreadWrite
, the role applies to all collections in the database (excluding some collections in thesystem
. database).- database
Name String Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.- role
Name String
- collection
Name string Collection for which the role applies. You can specify a collection for the
read
andreadWrite
roles. If you do not specify a collection forread
andreadWrite
, the role applies to all collections in the database (excluding some collections in thesystem
. database).- database
Name string Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.- role
Name string
- collection_
name str Collection for which the role applies. You can specify a collection for the
read
andreadWrite
roles. If you do not specify a collection forread
andreadWrite
, the role applies to all collections in the database (excluding some collections in thesystem
. database).- database_
name str Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.- role_
name str
- collection
Name String Collection for which the role applies. You can specify a collection for the
read
andreadWrite
roles. If you do not specify a collection forread
andreadWrite
, the role applies to all collections in the database (excluding some collections in thesystem
. database).- database
Name String Database on which the user has the specified role. A role on the
admin
database can include privileges that apply to the other databases.- role
Name String
GetDatabaseUserScope
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
mongodbatlas
Terraform Provider.