GetCustomDbRole
mongodbatlas..CustomDbRole describe a Custom DB Role. This represents a custom db role.
NOTE: Groups and projects are synonymous terms. You may find group_id in the official documentation.
Example Usage
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var testRole = new Mongodbatlas.CustomDbRole("testRole", new Mongodbatlas.CustomDbRoleArgs
{
Actions =
{
new Mongodbatlas.Inputs.CustomDbRoleActionArgs
{
Action = "UPDATE",
Resources =
{
new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
{
CollectionName = "",
DatabaseName = "anyDatabase",
},
},
},
new Mongodbatlas.Inputs.CustomDbRoleActionArgs
{
Action = "INSERT",
Resources =
{
new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
{
CollectionName = "",
DatabaseName = "anyDatabase",
},
},
},
},
ProjectId = "<PROJECT-ID>",
RoleName = "myCustomRole",
});
var test = Output.Tuple(testRole.ProjectId, testRole.RoleName).Apply(values =>
{
var projectId = values.Item1;
var roleName = values.Item2;
return Mongodbatlas.GetCustomDbRole.InvokeAsync(new Mongodbatlas.GetCustomDbRoleArgs
{
ProjectId = projectId,
RoleName = roleName,
});
});
}
}
Coming soon!
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test_role = mongodbatlas.CustomDbRole("testRole",
actions=[
{
"action": "UPDATE",
"resources": [{
"collectionName": "",
"database_name": "anyDatabase",
}],
},
{
"action": "INSERT",
"resources": [{
"collectionName": "",
"database_name": "anyDatabase",
}],
},
],
project_id="<PROJECT-ID>",
role_name="myCustomRole")
test = pulumi.Output.all(test_role.project_id, test_role.role_name).apply(lambda project_id, role_name: mongodbatlas.get_custom_db_role(project_id=project_id,
role_name=role_name))import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const testRole = new mongodbatlas.CustomDbRole("test_role", {
actions: [
{
action: "UPDATE",
resources: [{
collectionName: "",
databaseName: "anyDatabase",
}],
},
{
action: "INSERT",
resources: [{
collectionName: "",
databaseName: "anyDatabase",
}],
},
],
projectId: "<PROJECT-ID>",
roleName: "myCustomRole",
});
const test = pulumi.all([testRole.projectId, testRole.roleName]).apply(([projectId, roleName]) => mongodbatlas.getCustomDbRole({
projectId: projectId,
roleName: roleName,
}, { async: true }));Using GetCustomDbRole
function getCustomDbRole(args: GetCustomDbRoleArgs, opts?: InvokeOptions): Promise<GetCustomDbRoleResult>function get_custom_db_role(inherited_roles=None, project_id=None, role_name=None, opts=None)func LookupCustomDbRole(ctx *Context, args *LookupCustomDbRoleArgs, opts ...InvokeOption) (*LookupCustomDbRoleResult, error)Note: This function is named
LookupCustomDbRolein the Go SDK.
public static class GetCustomDbRole {
public static Task<GetCustomDbRoleResult> InvokeAsync(GetCustomDbRoleArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Project
Id string The unique ID for the project to create the database user.
- Role
Name string Name of the custom role.
- Inherited
Roles List<GetCustom Db Role Inherited Role Args>
- Project
Id string The unique ID for the project to create the database user.
- Role
Name string Name of the custom role.
- Inherited
Roles []GetCustom Db Role Inherited Role
- project
Id string The unique ID for the project to create the database user.
- role
Name string Name of the custom role.
- inherited
Roles GetCustom Db Role Inherited Role[]
- project_
id str The unique ID for the project to create the database user.
- role_
name str Name of the custom role.
- inherited_
roles List[GetCustom Db Role Inherited Role]
GetCustomDbRole Result
The following output properties are available:
- Actions
List<Get
Custom Db Role Action> - Id string
The provider-assigned unique ID for this managed resource.
- Project
Id string - Role
Name string - Inherited
Roles List<GetCustom Db Role Inherited Role>
- Actions
[]Get
Custom Db Role Action - Id string
The provider-assigned unique ID for this managed resource.
- Project
Id string - Role
Name string - Inherited
Roles []GetCustom Db Role Inherited Role
- actions
Get
Custom Db Role Action[] - id string
The provider-assigned unique ID for this managed resource.
- project
Id string - role
Name string - inherited
Roles GetCustom Db Role Inherited Role[]
- actions
List[Get
Custom Db Role Action] - id str
The provider-assigned unique ID for this managed resource.
- project_
id str - role_
name str - inherited_
roles List[GetCustom Db Role Inherited Role]
Supporting Types
GetCustomDbRoleAction
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- 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<Get
Custom Db Role Action Resource Args> (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
[]Get
Custom Db Role Action Resource (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
Get
Custom Db Role Action Resource[] (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
List[Get
Custom Db Role Action Resource] (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.
GetCustomDbRoleActionResource
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetCustomDbRoleInheritedRole
- Database
Name string - Role
Name string Name of the custom role.
- Database
Name string - Role
Name string Name of the custom role.
- database
Name string - role
Name string Name of the custom role.
- database_
name str - role_
name str Name of the custom role.
Package Details
- Repository
- https://github.com/pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlasTerraform Provider.