1. Packages
  2. MongoDB Atlas
  3. API Docs
  4. getCustomDbRoles
MongoDB Atlas v3.14.2 published on Monday, Mar 18, 2024 by Pulumi

mongodbatlas.getCustomDbRoles

Explore with Pulumi AI

mongodbatlas logo
MongoDB Atlas v3.14.2 published on Monday, Mar 18, 2024 by Pulumi

    mongodbatlas.getCustomDbRoles describe 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!```
    </pulumi-choosable>
    </div>
    <div>
    <pulumi-choosable type="language" values="python">
    

    Coming soon!```

    Coming soon!```
    </pulumi-choosable>
    </div>
    <div>
    <pulumi-choosable type="language" values="csharp">
    

    Coming soon!```

    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.DatabaseUser;
    import com.pulumi.mongodbatlas.DatabaseUserArgs;
    import com.pulumi.mongodbatlas.inputs.DatabaseUserRoleArgs;
    import com.pulumi.mongodbatlas.MongodbatlasFunctions;
    import com.pulumi.mongodbatlas.inputs.GetCustomDbRolesArgs;
    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 testDatabaseUser = new DatabaseUser("testDatabaseUser", DatabaseUserArgs.builder()        
                .username("test-acc-username")
                .password("test-acc-password")
                .projectId("<PROJECT-ID>")
                .databaseName("admin")
                .roles(            
                    DatabaseUserRoleArgs.builder()
                        .roleName("readWrite")
                        .databaseName("admin")
                        .build(),
                    DatabaseUserRoleArgs.builder()
                        .roleName("atlasAdmin")
                        .databaseName("admin")
                        .build())
                .build());
    
            final var testCustomDbRoles = MongodbatlasFunctions.getCustomDbRoles(GetCustomDbRolesArgs.builder()
                .projectId(mongodbatlas_custom_db_role.test().project_id())
                .build());
    
        }
    }
    
    resources:
      testDatabaseUser:
        type: mongodbatlas:DatabaseUser
        properties:
          username: test-acc-username
          password: test-acc-password
          projectId: <PROJECT-ID>
          databaseName: admin
          roles:
            - roleName: readWrite
              databaseName: admin
            - roleName: atlasAdmin
              databaseName: admin
    variables:
      testCustomDbRoles:
        fn::invoke:
          Function: mongodbatlas:getCustomDbRoles
          Arguments:
            projectId: ${mongodbatlas_custom_db_role.test.project_id}
    

    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>
    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]
    func LookupCustomDbRoles(ctx *Context, args *LookupCustomDbRolesArgs, opts ...InvokeOption) (*LookupCustomDbRolesResult, error)
    func LookupCustomDbRolesOutput(ctx *Context, args *LookupCustomDbRolesOutputArgs, opts ...InvokeOption) LookupCustomDbRolesResultOutput

    > 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)
    }
    public static CompletableFuture<GetCustomDbRolesResult> getCustomDbRoles(GetCustomDbRolesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: mongodbatlas:index/getCustomDbRoles:getCustomDbRoles
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProjectId string
    The unique ID for the project to get all custom db roles.
    ProjectId string
    The unique ID for the project to get all custom db roles.
    projectId String
    The unique ID for the project to get all custom db roles.
    projectId string
    The unique ID for the project to get all custom db roles.
    project_id str
    The unique ID for the project to get all custom db roles.
    projectId 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 List<GetCustomDbRolesResultAction>
    InheritedRoles List<GetCustomDbRolesResultInheritedRole>
    RoleName string
    (Required) Name of the inherited role. This can either be another custom role or a built-in role.
    Actions []GetCustomDbRolesResultAction
    InheritedRoles []GetCustomDbRolesResultInheritedRole
    RoleName string
    (Required) Name of the inherited role. This can either be another custom role or a built-in role.
    actions List<GetCustomDbRolesResultAction>
    inheritedRoles List<GetCustomDbRolesResultInheritedRole>
    roleName String
    (Required) Name of the inherited role. This can either be another custom role or a built-in role.
    actions GetCustomDbRolesResultAction[]
    inheritedRoles GetCustomDbRolesResultInheritedRole[]
    roleName string
    (Required) Name of the inherited role. This can either be another custom role or a built-in role.
    actions Sequence[GetCustomDbRolesResultAction]
    inherited_roles Sequence[GetCustomDbRolesResultInheritedRole]
    role_name str
    (Required) Name of the inherited role. This can either be another custom role or a built-in role.
    actions List<Property Map>
    inheritedRoles List<Property Map>
    roleName String
    (Required) Name of the inherited role. This can either be another custom role or a built-in role.

    GetCustomDbRolesResultAction

    Action string
    (Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
    Resources 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 string
    (Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
    Resources []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 String
    (Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
    resources 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 string
    (Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
    resources 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 str
    (Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
    resources 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 String
    (Required) Name of the privilege action. For a complete list of actions available in the Atlas API, see Custom Role Actions.
    resources 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 bool
    CollectionName string
    DatabaseName string
    (Required) Database on which the inherited role is granted.
    Cluster bool
    CollectionName string
    DatabaseName string
    (Required) Database on which the inherited role is granted.
    cluster Boolean
    collectionName String
    databaseName String
    (Required) Database on which the inherited role is granted.
    cluster boolean
    collectionName string
    databaseName string
    (Required) Database on which the inherited role is granted.
    cluster bool
    collection_name str
    database_name str
    (Required) Database on which the inherited role is granted.
    cluster Boolean
    collectionName String
    databaseName String
    (Required) Database on which the inherited role is granted.

    GetCustomDbRolesResultInheritedRole

    DatabaseName string
    (Required) Database on which the inherited role is granted.
    RoleName string
    (Required) Name of the inherited role. This can either be another custom role or a built-in role.
    DatabaseName string
    (Required) Database on which the inherited role is granted.
    RoleName string
    (Required) Name of the inherited role. This can either be another custom role or a built-in role.
    databaseName String
    (Required) Database on which the inherited role is granted.
    roleName String
    (Required) Name of the inherited role. This can either be another custom role or a built-in role.
    databaseName string
    (Required) Database on which the inherited role is granted.
    roleName string
    (Required) Name of the inherited role. This can either be another custom role or a built-in role.
    database_name str
    (Required) Database on which the inherited role is granted.
    role_name str
    (Required) Name of the inherited role. This can either be another custom role or a built-in role.
    databaseName String
    (Required) Database on which the inherited role is granted.
    roleName 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.
    mongodbatlas logo
    MongoDB Atlas v3.14.2 published on Monday, Mar 18, 2024 by Pulumi