Class GetDatabaseUsers
Inheritance
System.Object
GetDatabaseUsers
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Mongodbatlas
Assembly: Pulumi.Mongodbatlas.dll
Syntax
public static class GetDatabaseUsers
Methods
View SourceInvokeAsync(GetDatabaseUsersArgs, InvokeOptions)
mongodbatlas..getDatabaseUsers describe all Database Users. 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
groupIdin the official documentation.
{{% examples %}}
Example Usage
{{% example %}}
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var testDatabaseUser = new Mongodbatlas.DatabaseUser("testDatabaseUser", new Mongodbatlas.DatabaseUserArgs
{
Username = "test-acc-username",
Password = "test-acc-password",
ProjectId = "<PROJECT-ID>",
AuthDatabaseName = "admin",
Roles =
{
new Mongodbatlas.Inputs.DatabaseUserRoleArgs
{
RoleName = "readWrite",
DatabaseName = "admin",
},
new Mongodbatlas.Inputs.DatabaseUserRoleArgs
{
RoleName = "atlasAdmin",
DatabaseName = "admin",
},
},
Labels =
{
new Mongodbatlas.Inputs.DatabaseUserLabelArgs
{
Key = "key 1",
Value = "value 1",
},
new Mongodbatlas.Inputs.DatabaseUserLabelArgs
{
Key = "key 2",
Value = "value 2",
},
},
});
var testDatabaseUsers = testDatabaseUser.ProjectId.Apply(projectId => Mongodbatlas.GetDatabaseUsers.InvokeAsync(new Mongodbatlas.GetDatabaseUsersArgs
{
ProjectId = projectId,
}));
}
}
{{% /example %}} {{% /examples %}}
Declaration
public static Task<GetDatabaseUsersResult> InvokeAsync(GetDatabaseUsersArgs args, InvokeOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetDatabaseUsersArgs | args | |
| InvokeOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GetDatabaseUsersResult> |