diff --git a/.azuredevops/modulePipelines/ms.documentdb.databaseaccounts.yml b/.azuredevops/modulePipelines/ms.documentdb.databaseaccounts.yml index 4966965b0b..d7a849bdc1 100644 --- a/.azuredevops/modulePipelines/ms.documentdb.databaseaccounts.yml +++ b/.azuredevops/modulePipelines/ms.documentdb.databaseaccounts.yml @@ -46,6 +46,7 @@ stages: removeDeployment: '${{ parameters.removeDeployment }}' deploymentBlocks: - path: $(modulePath)/.parameters/mongodb.parameters.json + - path: $(modulePath)/.parameters/gremlindb.parameters.json - path: $(modulePath)/.parameters/plain.parameters.json - path: $(modulePath)/.parameters/sqldb.parameters.json diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/.test/gremlindb.parameters.json b/arm/Microsoft.DocumentDB/databaseAccounts/.test/gremlindb.parameters.json new file mode 100644 index 0000000000..e252a40107 --- /dev/null +++ b/arm/Microsoft.DocumentDB/databaseAccounts/.test/gremlindb.parameters.json @@ -0,0 +1,96 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>-az-cdb-gremlindb-001" + }, + "location": { + "value": "West Europe" + }, + "locations": { + "value": [ + { + "locationName": "West Europe", + "failoverPriority": 0, + "isZoneRedundant": false + }, + { + "locationName": "North Europe", + "failoverPriority": 1, + "isZoneRedundant": false + } + ] + }, + "roleAssignments": { + "value": [ + { + "roleDefinitionIdOrName": "Reader", + "principalIds": [ + "<>" + ] + } + ] + }, + "gremlinDatabases": { + "value": [ + { + "name": "<>-az-gdb-x-001", + "graphs": [ + { + "name": "car_collection", + "automaticIndexing": true, + "partitionKeyPaths": [ + "/car_id" + ] + }, + { + "name": "truck_collection", + "automaticIndexing": true, + "partitionKeyPaths": [ + "/truck_id" + ] + } + ] + }, + { + "name": "<>-az-gdb-x-002", + "collections": [ + { + "name": "bike_collection", + "automaticIndexing": true, + "partitionKeyPaths": [ + "/bike_id" + ] + }, + { + "name": "bicycle_collection", + "automaticIndexing": true, + "partitionKeyPaths": [ + "/bicycle_id" + ] + } + ] + } + ] + }, + "diagnosticLogsRetentionInDays": { + "value": 7 + }, + "diagnosticStorageAccountId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + }, + "diagnosticWorkspaceId": { + "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + }, + "diagnosticEventHubAuthorizationRuleId": { + "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + }, + "diagnosticEventHubName": { + "value": "adp-<>-az-evh-x-001" + }, + "systemAssignedIdentity": { + "value": true + } + } +} diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/.parameters/mongodb.parameters.json b/arm/Microsoft.DocumentDB/databaseAccounts/.test/mongodb.parameters.json similarity index 100% rename from arm/Microsoft.DocumentDB/databaseAccounts/.parameters/mongodb.parameters.json rename to arm/Microsoft.DocumentDB/databaseAccounts/.test/mongodb.parameters.json diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/.parameters/plain.parameters.json b/arm/Microsoft.DocumentDB/databaseAccounts/.test/plain.parameters.json similarity index 100% rename from arm/Microsoft.DocumentDB/databaseAccounts/.parameters/plain.parameters.json rename to arm/Microsoft.DocumentDB/databaseAccounts/.test/plain.parameters.json diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/.parameters/sqldb.parameters.json b/arm/Microsoft.DocumentDB/databaseAccounts/.test/sqldb.parameters.json similarity index 100% rename from arm/Microsoft.DocumentDB/databaseAccounts/.parameters/sqldb.parameters.json rename to arm/Microsoft.DocumentDB/databaseAccounts/.test/sqldb.parameters.json diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/deploy.bicep b/arm/Microsoft.DocumentDB/databaseAccounts/deploy.bicep index 1f603356aa..23b36ad8f3 100644 --- a/arm/Microsoft.DocumentDB/databaseAccounts/deploy.bicep +++ b/arm/Microsoft.DocumentDB/databaseAccounts/deploy.bicep @@ -50,8 +50,9 @@ param maxIntervalInSeconds int = 300 '3.2' '3.6' '4.0' + '4.2' ]) -param serverVersion string = '4.0' +param serverVersion string = '4.2' @description('Optional. SQL Databases configurations.') param sqlDatabases array = [] @@ -59,6 +60,9 @@ param sqlDatabases array = [] @description('Optional. MongoDB Databases configurations.') param mongodbDatabases array = [] +@description('Optional. Gremlin Databases configurations.') +param gremlinDatabases array = [] + @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true @@ -125,6 +129,49 @@ param diagnosticMetricsToEnable array = [ @description('Optional. The name of the diagnostic setting, if deployed.') param diagnosticSettingsName string = '${name}-diagnosticSettings' +@allowed([ + 'EnableCassandra' + 'EnableTable' + 'EnableGremlin' + 'EnableMongo' + 'DisableRateLimitingResponses' + 'EnableServerless' +]) +@description('Optional. List of Cosmos DB capabilities for the account.') +param capabilitiesToAdd array = [] + +@allowed([ + 'Periodic' + 'Continuous' +]) +@description('Optional. Describes the mode of backups.') +param backupPolicyType string = 'Continuous' + +@allowed([ + 'Continuous30Days' + 'Continuous7Days' +]) +@description('Optional. Configuration values for continuous mode backup.') +param backupPolicyContinuousTier string = 'Continuous30Days' + +@minValue(60) +@maxValue(1440) +@description('Optional. An integer representing the interval in minutes between two backups. Only applies to periodic backup type.') +param backupIntervalInMinutes int = 240 + +@minValue(2) +@maxValue(720) +@description('Optional. An integer representing the time (in hours) that each backup is retained. Only applies to periodic backup type.') +param backupRetentionIntervalInHours int = 8 + +@allowed([ + 'Geo' + 'Local' + 'Zone' +]) +@description('Optional. Enum to indicate type of backup residency. Only applies to periodic backup type.') +param backupStorageRedundancy string = 'Local' + var diagnosticsLogs = [for category in diagnosticLogCategoriesToEnable: { category: category enabled: true @@ -177,25 +224,49 @@ var databaseAccount_locations = [for location in locations: { locationName: location.locationName }] -var kind = !empty(sqlDatabases) ? 'GlobalDocumentDB' : (!empty(mongodbDatabases) ? 'MongoDB' : 'Parse') +var kind = !empty(sqlDatabases) || !empty(gremlinDatabases) ? 'GlobalDocumentDB' : (!empty(mongodbDatabases) ? 'MongoDB' : 'Parse') var enableReferencedModulesTelemetry = false -var databaseAccount_properties = !empty(sqlDatabases) ? { - consistencyPolicy: consistencyPolicy[defaultConsistencyLevel] - locations: databaseAccount_locations - databaseAccountOfferType: databaseAccountOfferType - enableAutomaticFailover: automaticFailover -} : (!empty(mongodbDatabases) ? { - consistencyPolicy: consistencyPolicy[defaultConsistencyLevel] - locations: databaseAccount_locations - databaseAccountOfferType: databaseAccountOfferType - apiProperties: { - serverVersion: serverVersion +var capabilities = [for capability in capabilitiesToAdd: { + name: capability +}] + +var backupPolicy = backupPolicyType == 'Continuous' ? { + type: backupPolicyType + continuousModeProperties: { + tier: backupPolicyContinuousTier } } : { - databaseAccountOfferType: databaseAccountOfferType -}) + type: backupPolicyType + periodicModeProperties: { + backupIntervalInMinutes: backupIntervalInMinutes + backupRetentionIntervalInHours: backupRetentionIntervalInHours + backupStorageRedundancy: backupStorageRedundancy + } +} + +var databaseAccount_properties = union({ + databaseAccountOfferType: databaseAccountOfferType + }, + // Common properties + ((!empty(sqlDatabases) || !empty(mongodbDatabases) || !empty(gremlinDatabases)) ? { + consistencyPolicy: consistencyPolicy[defaultConsistencyLevel] + locations: databaseAccount_locations + capabilities: capabilities + backupPolicy: backupPolicy + } : {}), + // SQLDB properties + (!empty(sqlDatabases) ? { + enableAutomaticFailover: automaticFailover + } : {}), + // MongoDb properties + (!empty(mongodbDatabases) ? { + apiProperties: { + serverVersion: serverVersion + } + } : {}) +) resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name, location)}' @@ -209,7 +280,7 @@ resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (ena } } -resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2021-06-15' = { +resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2022-02-15-preview' = { name: name location: location tags: tags @@ -271,6 +342,16 @@ module mongodbDatabases_resource 'mongodbDatabases/deploy.bicep' = [for mongodbD } }] +module gremlinDatabases_resource 'gremlinDatabases/deploy.bicep' = [for gremlinDatabase in gremlinDatabases: { + name: '${uniqueString(deployment().name, location)}-gremlin-${gremlinDatabase.name}' + params: { + databaseAccountName: databaseAccount.name + name: gremlinDatabase.name + graphs: contains(gremlinDatabase, 'graphs') ? gremlinDatabase.graphs : [] + enableDefaultTelemetry: enableReferencedModulesTelemetry + } +}] + @description('The name of the database account.') output name string = databaseAccount.name diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/deploy.bicep b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/deploy.bicep new file mode 100644 index 0000000000..ebaef62e11 --- /dev/null +++ b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/deploy.bicep @@ -0,0 +1,94 @@ +@description('Required. Name of the Gremlin database.') +param name string + +@description('Optional. Tags of the Gremlin database resource.') +param tags object = {} + +@description('Optional. Enables system assigned managed identity on the resource.') +param systemAssignedIdentity bool = false + +@description('Optional. The ID(s) to assign to the resource.') +param userAssignedIdentities object = {} + +@description('Conditional. The name of the parent Gremlin database. Required if the template is used in a standalone deployment.') +param databaseAccountName string + +@description('Optional. Array of graphs to deploy in the Gremlin database.') +param graphs array = [] + +@minValue(400) +@description('Optional. Represents maximum throughput, the resource can scale up to.') +param maxThroughput int = 0 + +@minValue(400) +@description('Optional. Request Units per second. For example, "throughput": 10000.') +param throughput int = 0 + +@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') +param enableDefaultTelemetry bool = false + +var enableReferencedModulesTelemetry = false + +var identityType = systemAssignedIdentity ? (!empty(userAssignedIdentities) ? 'SystemAssigned, UserAssigned' : 'SystemAssigned') : (!empty(userAssignedIdentities) ? 'UserAssigned' : 'None') + +var identity = identityType != 'None' ? { + type: identityType + userAssignedIdentities: !empty(userAssignedIdentities) ? userAssignedIdentities : null +} : null + +resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { + name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + properties: { + mode: 'Incremental' + template: { + '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' + contentVersion: '1.0.0.0' + resources: [] + } + } +} + +resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2022-02-15-preview' existing = { + name: databaseAccountName +} + +var databaseOptions = contains(databaseAccount.properties.capabilities, { name: 'EnableServerless' }) ? {} : { + autoscaleSettings: { + maxThroughput: maxThroughput + } + throughput: throughput +} + +resource gremlinDatabase 'Microsoft.DocumentDB/databaseAccounts/gremlinDatabases@2022-02-15-preview' = { + name: name + tags: tags + parent: databaseAccount + identity: identity + properties: { + options: databaseOptions + resource: { + id: name + } + } +} + +module gremlinGraphs 'graphs/deploy.bicep' = [for graph in graphs: { + name: '${uniqueString(deployment().name, gremlinDatabase.name)}-gremlindb-${graph.name}' + params: { + name: graph.name + gremlinDatabaseName: name + databaseAccountName: databaseAccountName + enableDefaultTelemetry: enableReferencedModulesTelemetry + automaticIndexing: contains(graph, 'automaticIndexing') ? graph.automaticIndexing : true + partitionKeyPaths: !empty(graph.partitionKeyPaths) ? graph.partitionKeyPaths : [] + } +}] + +@description('The name of the Gremlin database.') +output name string = gremlinDatabase.name + +@description('The resource ID of the Gremlin database.') +output resourceId string = gremlinDatabase.id + +@description('The name of the resource group the Gremlin database was created in.') +output resourceGroupName string = resourceGroup().name diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/deploy.bicep b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/deploy.bicep new file mode 100644 index 0000000000..59742e7da2 --- /dev/null +++ b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/deploy.bicep @@ -0,0 +1,66 @@ +@description('Required. Name of the graph.') +param name string + +@description('Optional. Tags of the Gremlin graph resource.') +param tags object = {} + +@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') +param enableDefaultTelemetry bool = true + +@description('Conditional. The name of the parent Database Account. Required if the template is used in a standalone deployment.') +param databaseAccountName string + +@description('Conditional. The name of the parent Gremlin Database. Required if the template is used in a standalone deployment.') +param gremlinDatabaseName string + +@description('Optional. Indicates if the indexing policy is automatic.') +param automaticIndexing bool = true + +@description('Optional. List of paths using which data within the container can be partitioned.') +param partitionKeyPaths array = [] + +resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { + name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + properties: { + mode: 'Incremental' + template: { + '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' + contentVersion: '1.0.0.0' + resources: [] + } + } +} + +resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2022-02-15-preview' existing = { + name: databaseAccountName + + resource gremlinDatabase 'gremlinDatabases@2022-02-15-preview' existing = { + name: gremlinDatabaseName + } +} + +resource gremlinGraph 'Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs@2022-02-15-preview' = { + name: name + tags: tags + parent: databaseAccount::gremlinDatabase + properties: { + resource: { + id: name + indexingPolicy: { + automatic: automaticIndexing + } + partitionKey: { + paths: !empty(partitionKeyPaths) ? partitionKeyPaths : null + } + } + } +} + +@description('The name of the graph.') +output name string = gremlinGraph.name + +@description('The resource ID of the graph.') +output resourceId string = gremlinGraph.id + +@description('The name of the resource group the graph was created in.') +output resourceGroupName string = resourceGroup().name diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/readme.md b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/readme.md new file mode 100644 index 0000000000..a03f7cb937 --- /dev/null +++ b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/readme.md @@ -0,0 +1,118 @@ +# DocumentDB DatabaseAccounts GremlinDatabases Graphs `[Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs]` + +This module deploys DocumentDB DatabaseAccounts GremlinDatabases Graphs. + +## Navigation + +- [Resource Types](#Resource-Types) +- [Parameters](#Parameters) +- [Outputs](#Outputs) + +## Resource Types + +| Resource Type | API Version | +| :-- | :-- | +| `Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs` | [2022-02-15-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DocumentDB/2022-02-15-preview/databaseAccounts/gremlinDatabases/graphs) | + +## Parameters + +**Required parameters** +| Parameter Name | Type | Description | +| :-- | :-- | :-- | +| `name` | string | Name of the graph. | + +**Conditional parameters** +| Parameter Name | Type | Description | +| :-- | :-- | :-- | +| `databaseAccountName` | string | The name of the parent Database Account. Required if the template is used in a standalone deployment. | +| `gremlinDatabaseName` | string | The name of the parent Gremlin Database. Required if the template is used in a standalone deployment. | + +**Optional parameters** +| Parameter Name | Type | Default Value | Allowed Values | Description | +| :-- | :-- | :-- | :-- | :-- | +| `automaticIndexing` | bool | `True` | | Indicates if the indexing policy is automatic. | +| `enableDefaultTelemetry` | bool | `False` | | Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `kind` | string | `'Hash'` | `[Hash, MultiHash, Range]` | Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (up to three maximum) are supported for container create. | +| `partitionKeyPaths` | array | `[]` | | List of paths using which data within the container can be partitioned. | +| `tags` | object | `{object}` | | Tags of the Gremlin graph resource. | + + +### Parameter Usage: `tags` + +Tag names and tag values can be provided as needed. A tag can be left without a value. + +
+ +Parameter JSON format + +```json +"tags": { + "value": { + "Environment": "Non-Prod", + "Contact": "test.user@testcompany.com", + "PurchaseOrder": "1234", + "CostCenter": "7890", + "ServiceName": "DeploymentValidation", + "Role": "DeploymentValidation" + } +} +``` + +
+ +
+ +Bicep format + +```bicep +tags: { + Environment: 'Non-Prod' + Contact: 'test.user@testcompany.com' + PurchaseOrder: '1234' + CostCenter: '7890' + ServiceName: 'DeploymentValidation' + Role: 'DeploymentValidation' +} +``` + +
+

+ +### Parameter Usage: `partitionKeyPaths`, `uniqueKeyPaths` + +Different kinds of paths can be provided as array of strings: + +

+ +Bicep format + +```bicep +graphs: [ + { + name: 'graph01' + automaticIndexing: true + partitionKeyPaths: [ + '/name' + ], + + } + { + name: 'graph02' + automaticIndexing: true + partitionKeyPaths: [ + '/address' + ] + } +] +``` + +
+

+ +## Outputs + +| Output Name | Type | Description | +| :-- | :-- | :-- | +| `name` | string | The name of the graph. | +| `resourceGroupName` | string | The name of the resource group the graph was created in. | +| `resourceId` | string | The resource ID of the graph. | diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/version.json b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/version.json new file mode 100644 index 0000000000..56f8d9ca40 --- /dev/null +++ b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/version.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", + "version": "0.4" +} diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/readme.md b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/readme.md new file mode 100644 index 0000000000..0e980359e0 --- /dev/null +++ b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/readme.md @@ -0,0 +1,178 @@ +# DocumentDB DatabaseAccounts GremlinDatabases `[Microsoft.DocumentDB/databaseAccounts/gremlinDatabases]` + +This module deploys a GremlinDB within a CosmosDB account. + +## Navigation + +- [Resource Types](#Resource-Types) +- [Parameters](#Parameters) +- [Outputs](#Outputs) + +## Resource Types + +| Resource Type | API Version | +| :-- | :-- | +| `Microsoft.DocumentDB/databaseAccounts/gremlinDatabases` | [2022-02-15-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DocumentDB/2022-02-15-preview/databaseAccounts/gremlinDatabases) | +| `Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs` | [2022-02-15-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DocumentDB/2022-02-15-preview/databaseAccounts/gremlinDatabases/graphs) | + +## Parameters + +**Required parameters** +| Parameter Name | Type | Description | +| :-- | :-- | :-- | +| `name` | string | Name of the Gremlin database. | + +**Conditional parameters** +| Parameter Name | Type | Description | +| :-- | :-- | :-- | +| `databaseAccountName` | string | The name of the parent Gremlin database. Required if the template is used in a standalone deployment. | + +**Optional parameters** +| Parameter Name | Type | Default Value | Description | +| :-- | :-- | :-- | :-- | +| `enableDefaultTelemetry` | bool | `False` | Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `graphs` | _[graphs](graphs/readme.md)_ array | `[]` | Array of graphs to deploy in the SQL database. | +| `maxThroughput` | int | `0` | Represents maximum throughput, the resource can scale up to. | +| `systemAssignedIdentity` | bool | `False` | Enables system assigned managed identity on the resource. | +| `tags` | object | `{object}` | Tags of the Gremlin database resource. | +| `throughput` | int | `0` | Request Units per second. For example, "throughput": 10000. | +| `userAssignedIdentities` | object | `{object}` | The ID(s) to assign to the resource. | + + +### Parameter Usage: `graphs` + +List of graph databaseAccounts + +

+ +Parameter JSON format + +```json +"graphs": { + "value": [ + { + "name": "graph01", + "automaticIndexing": true, + "partitionKeyPaths": [ + "/name" + ] + }, + { + "name": "graph02", + "automaticIndexing": true, + "partitionKeyPaths": [ + "/name" + ] + } + ] +} +``` + +
+ +
+ +Bicep format + +```bicep +graphs: [ + { + name: 'graph01' + automaticIndexing: true + partitionKeyPaths: [ + '/name' + ] + } + { + name: 'graph02' + automaticIndexing: true + partitionKeyPaths: [ + '/name' + ] + } +] +``` + +
+ +### Parameter Usage: `tags` + +Tag names and tag values can be provided as needed. A tag can be left without a value. + +
+ +Parameter JSON format + +```json +"tags": { + "value": { + "Environment": "Non-Prod", + "Contact": "test.user@testcompany.com", + "PurchaseOrder": "1234", + "CostCenter": "7890", + "ServiceName": "DeploymentValidation", + "Role": "DeploymentValidation" + } +} +``` + +
+ +
+ +Bicep format + +```bicep +tags: { + Environment: 'Non-Prod' + Contact: 'test.user@testcompany.com' + PurchaseOrder: '1234' + CostCenter: '7890' + ServiceName: 'DeploymentValidation' + Role: 'DeploymentValidation' +} +``` + +
+

+ +### Parameter Usage: `userAssignedIdentities` + +You can specify multiple user assigned identities to a resource by providing additional resource IDs using the following format: + +

+ +Parameter JSON format + +```json +"userAssignedIdentities": { + "value": { + "/subscriptions/12345678-1234-1234-1234-123456789012/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-sxx-az-msi-x-001": {}, + "/subscriptions/12345678-1234-1234-1234-123456789012/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-sxx-az-msi-x-002": {} + } +} +``` + +
+ +
+ +Bicep format + +```bicep +userAssignedIdentities: { + '/subscriptions/12345678-1234-1234-1234-123456789012/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-sxx-az-msi-x-001': {} + '/subscriptions/12345678-1234-1234-1234-123456789012/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-sxx-az-msi-x-002': {} +} +``` + +
+

+ +## Outputs + +| Output Name | Type | Description | +| :-- | :-- | :-- | +| `name` | string | The name of the Gremlin database. | +| `resourceGroupName` | string | The name of the resource group the Gremlin database was created in. | +| `resourceId` | string | The resource ID of the Gremlin database. | diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/version.json b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/version.json new file mode 100644 index 0000000000..56f8d9ca40 --- /dev/null +++ b/arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/version.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", + "version": "0.4" +} diff --git a/arm/Microsoft.DocumentDB/databaseAccounts/readme.md b/arm/Microsoft.DocumentDB/databaseAccounts/readme.md index 9fa1394988..990b601984 100644 --- a/arm/Microsoft.DocumentDB/databaseAccounts/readme.md +++ b/arm/Microsoft.DocumentDB/databaseAccounts/readme.md @@ -15,7 +15,9 @@ This module deploys a DocumentDB database account and its child resources. | :-- | :-- | | `Microsoft.Authorization/locks` | [2017-04-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2017-04-01/locks) | | `Microsoft.Authorization/roleAssignments` | [2020-10-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-10-01-preview/roleAssignments) | -| `Microsoft.DocumentDB/databaseAccounts` | [2021-06-15](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DocumentDB/2021-06-15/databaseAccounts) | +| `Microsoft.DocumentDB/databaseAccounts` | [2022-02-15-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DocumentDB/2022-02-15-preview/databaseAccounts) | +| `Microsoft.DocumentDB/databaseAccounts/gremlinDatabases` | [2022-02-15-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DocumentDB/2022-02-15-preview/databaseAccounts/gremlinDatabases) | +| `Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs` | [2022-02-15-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DocumentDB/2022-02-15-preview/databaseAccounts/gremlinDatabases/graphs) | | `Microsoft.DocumentDB/databaseAccounts/mongodbDatabases` | [2021-07-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DocumentDB/2021-07-01-preview/databaseAccounts/mongodbDatabases) | | `Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections` | [2021-07-01-preview](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DocumentDB/2021-07-01-preview/databaseAccounts/mongodbDatabases/collections) | | `Microsoft.DocumentDB/databaseAccounts/sqlDatabases` | [2021-06-15](https://docs.microsoft.com/en-us/azure/templates/Microsoft.DocumentDB/2021-06-15/databaseAccounts/sqlDatabases) | @@ -34,6 +36,12 @@ This module deploys a DocumentDB database account and its child resources. | Parameter Name | Type | Default Value | Allowed Values | Description | | :-- | :-- | :-- | :-- | :-- | | `automaticFailover` | bool | `True` | | Enable automatic failover for regions. | +| `backupIntervalInMinutes` | int | `240` | | An integer representing the interval in minutes between two backups. Only applies to periodic backup type. | +| `backupPolicyContinuousTier` | string | `'Continuous30Days'` | `[Continuous30Days, Continuous7Days]` | Configuration values for continuous mode backup. | +| `backupPolicyType` | string | `'Continuous'` | `[Periodic, Continuous]` | Describes the mode of backups. | +| `backupRetentionIntervalInHours` | int | `8` | | An integer representing the time (in hours) that each backup is retained. Only applies to periodic backup type. | +| `backupStorageRedundancy` | string | `'Local'` | `[Geo, Local, Zone]` | Enum to indicate type of backup residency. Only applies to periodic backup type. | +| `capabilitiesToAdd` | array | `[]` | `[EnableCassandra, EnableTable, EnableGremlin, EnableMongo, DisableRateLimitingResponses, EnableServerless]` | List of Cosmos DB capabilities for the account. | | `databaseAccountOfferType` | string | `'Standard'` | `[Standard]` | The offer type for the Cosmos DB database account. | | `defaultConsistencyLevel` | string | `'Session'` | `[Eventual, ConsistentPrefix, Session, BoundedStaleness, Strong]` | The default consistency level of the Cosmos DB account. | | `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. | @@ -45,13 +53,14 @@ This module deploys a DocumentDB database account and its child resources. | `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. | | `diagnosticWorkspaceId` | string | `''` | | Resource ID of the log analytics workspace. | | `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `gremlinDatabases` | _[gremlinDatabases](gremlinDatabases/readme.md)_ array | `[]` | | Gremlin Databases configurations. | | `location` | string | `[resourceGroup().location]` | | Location for all resources. | | `lock` | string | `''` | `[, CanNotDelete, ReadOnly]` | Specify the type of lock. | | `maxIntervalInSeconds` | int | `300` | | Max lag time (minutes). Required for BoundedStaleness. Valid ranges, Single Region: 5 to 84600. Multi Region: 300 to 86400. | | `maxStalenessPrefix` | int | `100000` | | Max stale requests. Required for BoundedStaleness. Valid ranges, Single Region: 10 to 1000000. Multi Region: 100000 to 1000000. | | `mongodbDatabases` | _[mongodbDatabases](mongodbDatabases/readme.md)_ array | `[]` | | MongoDB Databases configurations. | | `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalIds' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. | -| `serverVersion` | string | `'4.0'` | `[3.2, 3.6, 4.0]` | Specifies the MongoDB server version to use. | +| `serverVersion` | string | `'4.2'` | `[3.2, 3.6, 4.0, 4.2]` | Specifies the MongoDB server version to use. | | `sqlDatabases` | _[sqlDatabases](sqlDatabases/readme.md)_ array | `[]` | | SQL Databases configurations. | | `systemAssignedIdentity` | bool | `False` | | Enables system assigned managed identity on the resource. | | `tags` | object | `{object}` | | Tags of the Database Account resource. | @@ -299,6 +308,73 @@ mongodbDatabases: [ Please reference the documentation for [mongodbDatabases](./mongodbDatabases/readme.md) +### Parameter Usage: `gremlinDatabases` + +

+ +Parameter JSON format + +```json +"mongodbDatabases": { + "value": [ + { + "name": "graphDb01", + "graphs": [ + { + "name": "graph01", + "automaticIndexing": true, + "partitionKeyPaths": [ + "/name" + ] + }, + { + "name": "graph02", + "automaticIndexing": true, + "partitionKeyPaths": [ + "/name" + ] + } + ] + } + ] +} +``` + +
+ +
+ +Bicep format + +```bicep +gremlinDatabases: [ + { + name: 'graphDb01' + graphs: [ + { + name: 'graph01' + automaticIndexing: true + partitionKeyPaths: [ + '/name' + ] + } + { + name: 'graph02' + automaticIndexing: true + partitionKeyPaths: [ + '/name' + ] + } + ] + } +] +``` + +
+

+ +Please reference the documentation for [gremlinDatabases](./gremlinDatabases/readme.md) + ### Parameter Usage: `roleAssignments` Create a role assignment for the given resource. If you want to assign a service principal / managed identity that is created in the same deployment, make sure to also specify the `'principalType'` parameter and set it to 'ServicePrincipal'. This will ensure the role assignment waits for the principal's propagation in Azure.