Microsoft.DocumentDB databaseAccounts/mongodbRoleDefinitions 2023-11-15-preview

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@2023-11-15-preview' = {
  name: 'string'
  parent: resourceSymbolicName
  properties: {
    databaseName: 'string'
    privileges: [
      {
        actions: [
          'string'
        ]
        resource: {
          collection: 'string'
          db: 'string'
        }
      }
    ]
    roleName: 'string'
    roles: [
      {
        db: 'string'
        role: 'string'
      }
    ]
    type: 'string'
  }
}

Property values

databaseAccounts/mongodbRoleDefinitions

Name Description Value
name The resource name

See how to set names and types for child resources in Bicep.
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": "2023-11-15-preview",
  "name": "string",
  "properties": {
    "databaseName": "string",
    "privileges": [
      {
        "actions": [ "string" ],
        "resource": {
          "collection": "string",
          "db": "string"
        }
      }
    ],
    "roleName": "string",
    "roles": [
      {
        "db": "string",
        "role": "string"
      }
    ],
    "type": "string"
  }
}

Property values

databaseAccounts/mongodbRoleDefinitions

Name Description Value
type The resource type 'Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions'
apiVersion The resource api version '2023-11-15-preview'
name The resource name

See how to set names and types for child resources in JSON ARM templates.
string (required)
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

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@2023-11-15-preview"
  name = "string"
  parent_id = "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

databaseAccounts/mongodbRoleDefinitions

Name Description Value
type The resource type "Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions@2023-11-15-preview"
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

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