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

mongodbatlas.getCustomDbRoles

Explore with Pulumi AI

# Data Source: mongodbatlas.getCustomDbRoles

mongodbatlas.getCustomDbRoles describes all Custom DB Roles. This represents a custom db roles.

NOTE: Groups and projects are synonymous terms. You may find groupId in the official documentation.

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
  testDatabaseUser:
    type: mongodbatlas:DatabaseUser
    name: test
    properties:
      username: test-acc-username
      password: test-acc-password
      projectId: <PROJECT-ID>
      databaseName: admin
      roles:
        - roleName: readWrite
          databaseName: admin
        - roleName: atlasAdmin
          databaseName: admin
variables:
  test:
    fn::invoke:
      function: mongodbatlas:getCustomDbRoles
      arguments:
        projectId: ${testMongodbatlasCustomDbRole.projectId}
Copy

Using getCustomDbRoles

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 getCustomDbRoles(args: GetCustomDbRolesArgs, opts?: InvokeOptions): Promise<GetCustomDbRolesResult>
function getCustomDbRolesOutput(args: GetCustomDbRolesOutputArgs, opts?: InvokeOptions): Output<GetCustomDbRolesResult>
Copy
def get_custom_db_roles(project_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetCustomDbRolesResult
def get_custom_db_roles_output(project_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetCustomDbRolesResult]
Copy
func LookupCustomDbRoles(ctx *Context, args *LookupCustomDbRolesArgs, opts ...InvokeOption) (*LookupCustomDbRolesResult, error)
func LookupCustomDbRolesOutput(ctx *Context, args *LookupCustomDbRolesOutputArgs, opts ...InvokeOption) LookupCustomDbRolesResultOutput
Copy

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

public static class GetCustomDbRoles 
{
    public static Task<GetCustomDbRolesResult> InvokeAsync(GetCustomDbRolesArgs args, InvokeOptions? opts = null)
    public static Output<GetCustomDbRolesResult> Invoke(GetCustomDbRolesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetCustomDbRolesResult> getCustomDbRoles(GetCustomDbRolesArgs args, InvokeOptions options)
public static Output<GetCustomDbRolesResult> getCustomDbRoles(GetCustomDbRolesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: mongodbatlas:index/getCustomDbRoles:getCustomDbRoles
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ProjectId This property is required. string
The unique ID for the project to get all custom db roles.
ProjectId This property is required. string
The unique ID for the project to get all custom db roles.
projectId This property is required. String
The unique ID for the project to get all custom db roles.
projectId This property is required. string
The unique ID for the project to get all custom db roles.
project_id This property is required. str
The unique ID for the project to get all custom db roles.
projectId This property is required. String
The unique ID for the project to get all custom db roles.

getCustomDbRoles Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
ProjectId string
Results List<GetCustomDbRolesResult>
A list where each represents a custom db roles.
Id string
The provider-assigned unique ID for this managed resource.
ProjectId string
Results []GetCustomDbRolesResult
A list where each represents a custom db roles.
id String
The provider-assigned unique ID for this managed resource.
projectId String
results List<GetCustomDbRolesResult>
A list where each represents a custom db roles.
id string
The provider-assigned unique ID for this managed resource.
projectId string
results GetCustomDbRolesResult[]
A list where each represents a custom db roles.
id str
The provider-assigned unique ID for this managed resource.
project_id str
results Sequence[GetCustomDbRolesResult]
A list where each represents a custom db roles.
id String
The provider-assigned unique ID for this managed resource.
projectId String
results List<Property Map>
A list where each represents a custom db roles.

Supporting Types

GetCustomDbRolesResult

Actions This property is required. List<GetCustomDbRolesResultAction>
InheritedRoles This property is required. List<GetCustomDbRolesResultInheritedRole>
RoleName This property is required. string
(Required) Name of the inherited role. This can either be another custom role or a built-in role.
Actions This property is required. []GetCustomDbRolesResultAction
InheritedRoles This property is required. []GetCustomDbRolesResultInheritedRole
RoleName This property is required. string
(Required) Name of the inherited role. This can either be another custom role or a built-in role.
actions This property is required. List<GetCustomDbRolesResultAction>
inheritedRoles This property is required. List<GetCustomDbRolesResultInheritedRole>
roleName This property is required. String
(Required) Name of the inherited role. This can either be another custom role or a built-in role.
actions This property is required. GetCustomDbRolesResultAction[]
inheritedRoles This property is required. GetCustomDbRolesResultInheritedRole[]
roleName This property is required. string
(Required) Name of the inherited role. This can either be another custom role or a built-in role.
actions This property is required. Sequence[GetCustomDbRolesResultAction]
inherited_roles This property is required. Sequence[GetCustomDbRolesResultInheritedRole]
role_name This property is required. str
(Required) Name of the inherited role. This can either be another custom role or a built-in role.
actions This property is required. List<Property Map>
inheritedRoles This property is required. List<Property Map>
roleName This property is required. String
(Required) Name of the inherited role. This can either be another custom role or a built-in role.

GetCustomDbRolesResultAction

Action This property is required. string
(Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
Resources This property is required. List<GetCustomDbRolesResultActionResource>
(Required) Contains information on where the action is granted. Each object in the array either indicates a database and collection on which the action is granted, or indicates that the action is granted on the cluster resource.
Action This property is required. string
(Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
Resources This property is required. []GetCustomDbRolesResultActionResource
(Required) Contains information on where the action is granted. Each object in the array either indicates a database and collection on which the action is granted, or indicates that the action is granted on the cluster resource.
action This property is required. String
(Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
resources This property is required. List<GetCustomDbRolesResultActionResource>
(Required) Contains information on where the action is granted. Each object in the array either indicates a database and collection on which the action is granted, or indicates that the action is granted on the cluster resource.
action This property is required. string
(Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
resources This property is required. GetCustomDbRolesResultActionResource[]
(Required) Contains information on where the action is granted. Each object in the array either indicates a database and collection on which the action is granted, or indicates that the action is granted on the cluster resource.
action This property is required. str
(Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
resources This property is required. Sequence[GetCustomDbRolesResultActionResource]
(Required) Contains information on where the action is granted. Each object in the array either indicates a database and collection on which the action is granted, or indicates that the action is granted on the cluster resource.
action This property is required. String
(Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
resources This property is required. List<Property Map>
(Required) Contains information on where the action is granted. Each object in the array either indicates a database and collection on which the action is granted, or indicates that the action is granted on the cluster resource.

GetCustomDbRolesResultActionResource

Cluster This property is required. bool
CollectionName This property is required. string
DatabaseName This property is required. string
(Required) Database on which the inherited role is granted.
Cluster This property is required. bool
CollectionName This property is required. string
DatabaseName This property is required. string
(Required) Database on which the inherited role is granted.
cluster This property is required. Boolean
collectionName This property is required. String
databaseName This property is required. String
(Required) Database on which the inherited role is granted.
cluster This property is required. boolean
collectionName This property is required. string
databaseName This property is required. string
(Required) Database on which the inherited role is granted.
cluster This property is required. bool
collection_name This property is required. str
database_name This property is required. str
(Required) Database on which the inherited role is granted.
cluster This property is required. Boolean
collectionName This property is required. String
databaseName This property is required. String
(Required) Database on which the inherited role is granted.

GetCustomDbRolesResultInheritedRole

DatabaseName This property is required. string
(Required) Database on which the inherited role is granted.
RoleName This property is required. string
(Required) Name of the inherited role. This can either be another custom role or a built-in role.
DatabaseName This property is required. string
(Required) Database on which the inherited role is granted.
RoleName This property is required. string
(Required) Name of the inherited role. This can either be another custom role or a built-in role.
databaseName This property is required. String
(Required) Database on which the inherited role is granted.
roleName This property is required. String
(Required) Name of the inherited role. This can either be another custom role or a built-in role.
databaseName This property is required. string
(Required) Database on which the inherited role is granted.
roleName This property is required. string
(Required) Name of the inherited role. This can either be another custom role or a built-in role.
database_name This property is required. str
(Required) Database on which the inherited role is granted.
role_name This property is required. str
(Required) Name of the inherited role. This can either be another custom role or a built-in role.
databaseName This property is required. String
(Required) Database on which the inherited role is granted.
roleName This property is required. String
(Required) Name of the inherited role. This can either be another custom role or a built-in role.

Package Details

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