Partager via


Microsoft.DocumentDB databaseAccounts/mongodbRoleDefinitions 2024-08-15

Bicep resource definition

The databaseAccounts/mongodbRoleDefinitions resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions@2024-08-15' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    databaseName: 'string'
    privileges: [
      {
        actions: [
          'string'
        ]
        resource: {
          collection: 'string'
          db: 'string'
        }
      }
    ]
    roleName: 'string'
    roles: [
      {
        db: 'string'
        role: 'string'
      }
    ]
    type: 'string'
  }
}

Property values

Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions

Name Description Value
name The resource name string (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: databaseAccounts
properties Properties to create and update an Azure Cosmos DB Mongo Role Definition. MongoRoleDefinitionResource

MongoRoleDefinitionResource

Name Description Value
databaseName The database name for which access is being granted for this Role Definition. string
privileges A set of privileges contained by the Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Scopes higher than Database are not enforceable as privilege. Privilege[]
roleName A user-friendly name for the Role Definition. Must be unique for the database account. string
roles The set of roles inherited by this Role Definition. Role[]
type Indicates whether the Role Definition was built-in or user created. 'BuiltInRole'
'CustomRole'

Privilege

Name Description Value
actions An array of actions that are allowed. string[]
resource An Azure Cosmos DB Mongo DB Resource. PrivilegeResource

PrivilegeResource

Name Description Value
collection The collection name the role is applied. string
db The database name the role is applied. string

Role

Name Description Value
db The database name the role is applied. string
role The role name. string

ARM template resource definition

The databaseAccounts/mongodbRoleDefinitions resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions resource, add the following JSON to your template.

{
  "type": "Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions",
  "apiVersion": "2024-08-15",
  "name": "string",
  "properties": {
    "databaseName": "string",
    "privileges": [
      {
        "actions": [ "string" ],
        "resource": {
          "collection": "string",
          "db": "string"
        }
      }
    ],
    "roleName": "string",
    "roles": [
      {
        "db": "string",
        "role": "string"
      }
    ],
    "type": "string"
  }
}

Property values

Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions

Name Description Value
apiVersion The api version '2024-08-15'
name The resource name string (required)
properties Properties to create and update an Azure Cosmos DB Mongo Role Definition. MongoRoleDefinitionResource
type The resource type 'Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions'

MongoRoleDefinitionResource

Name Description Value
databaseName The database name for which access is being granted for this Role Definition. string
privileges A set of privileges contained by the Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Scopes higher than Database are not enforceable as privilege. Privilege[]
roleName A user-friendly name for the Role Definition. Must be unique for the database account. string
roles The set of roles inherited by this Role Definition. Role[]
type Indicates whether the Role Definition was built-in or user created. 'BuiltInRole'
'CustomRole'

Privilege

Name Description Value
actions An array of actions that are allowed. string[]
resource An Azure Cosmos DB Mongo DB Resource. PrivilegeResource

PrivilegeResource

Name Description Value
collection The collection name the role is applied. string
db The database name the role is applied. string

Role

Name Description Value
db The database name the role is applied. string
role The role name. string

Terraform (AzAPI provider) resource definition

The databaseAccounts/mongodbRoleDefinitions resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions@2024-08-15"
  name = "string"
  body = jsonencode({
    properties = {
      databaseName = "string"
      privileges = [
        {
          actions = [
            "string"
          ]
          resource = {
            collection = "string"
            db = "string"
          }
        }
      ]
      roleName = "string"
      roles = [
        {
          db = "string"
          role = "string"
        }
      ]
      type = "string"
    }
  })
}

Property values

Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions

Name Description Value
name The resource name string (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: databaseAccounts
properties Properties to create and update an Azure Cosmos DB Mongo Role Definition. MongoRoleDefinitionResource
type The resource type "Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions@2024-08-15"

MongoRoleDefinitionResource

Name Description Value
databaseName The database name for which access is being granted for this Role Definition. string
privileges A set of privileges contained by the Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Scopes higher than Database are not enforceable as privilege. Privilege[]
roleName A user-friendly name for the Role Definition. Must be unique for the database account. string
roles The set of roles inherited by this Role Definition. Role[]
type Indicates whether the Role Definition was built-in or user created. 'BuiltInRole'
'CustomRole'

Privilege

Name Description Value
actions An array of actions that are allowed. string[]
resource An Azure Cosmos DB Mongo DB Resource. PrivilegeResource

PrivilegeResource

Name Description Value
collection The collection name the role is applied. string
db The database name the role is applied. string

Role

Name Description Value
db The database name the role is applied. string
role The role name. string