diff --git a/modules/Microsoft.DocumentDB/databaseAccounts/.test/gremlindb/deploy.test.bicep b/modules/Microsoft.DocumentDB/databaseAccounts/.test/gremlindb/deploy.test.bicep index d8f7c71005..031c6907c5 100644 --- a/modules/Microsoft.DocumentDB/databaseAccounts/.test/gremlindb/deploy.test.bicep +++ b/modules/Microsoft.DocumentDB/databaseAccounts/.test/gremlindb/deploy.test.bicep @@ -83,14 +83,18 @@ module testDeployment '../../deploy.bicep' = { { graphs: [ { - automaticIndexing: true + indexingPolicy: { + automatic: true + } name: 'car_collection' partitionKeyPaths: [ '/car_id' ] } { - automaticIndexing: true + indexingPolicy: { + automatic: true + } name: 'truck_collection' partitionKeyPaths: [ '/truck_id' @@ -102,14 +106,18 @@ module testDeployment '../../deploy.bicep' = { { collections: [ { - automaticIndexing: true + indexingPolicy: { + automatic: true + } name: 'bike_collection' partitionKeyPaths: [ '/bike_id' ] } { - automaticIndexing: true + indexingPolicy: { + automatic: true + } name: 'bicycle_collection' partitionKeyPaths: [ '/bicycle_id' diff --git a/modules/Microsoft.DocumentDB/databaseAccounts/.test/sqldb/deploy.test.bicep b/modules/Microsoft.DocumentDB/databaseAccounts/.test/sqldb/deploy.test.bicep index 746545e569..7efb88ba79 100644 --- a/modules/Microsoft.DocumentDB/databaseAccounts/.test/sqldb/deploy.test.bicep +++ b/modules/Microsoft.DocumentDB/databaseAccounts/.test/sqldb/deploy.test.bicep @@ -92,6 +92,9 @@ module testDeployment '../../deploy.bicep' = { { kind: 'Hash' name: 'container-001' + indexingPolicy: { + automatic: true + } paths: [ '/myPartitionKey' ] diff --git a/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/deploy.bicep b/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/deploy.bicep index 2fbea19aa1..075ca6afb1 100644 --- a/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/deploy.bicep +++ b/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/deploy.bicep @@ -77,7 +77,7 @@ module gremlinDatabase_gremlinGraphs 'graphs/deploy.bicep' = [for graph in graph gremlinDatabaseName: name databaseAccountName: databaseAccountName enableDefaultTelemetry: enableReferencedModulesTelemetry - automaticIndexing: contains(graph, 'automaticIndexing') ? graph.automaticIndexing : true + indexingPolicy: contains(graph, 'indexingPolicy') ? graph.indexingPolicy : true partitionKeyPaths: !empty(graph.partitionKeyPaths) ? graph.partitionKeyPaths : [] } }] diff --git a/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/deploy.bicep b/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/deploy.bicep index e5f31774e5..b8fdee416e 100644 --- a/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/deploy.bicep +++ b/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/deploy.bicep @@ -13,8 +13,8 @@ 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. Indexing policy of the graph.') +param indexingPolicy object = {} @description('Optional. List of paths using which data within the container can be partitioned.') param partitionKeyPaths array = [] @@ -46,9 +46,7 @@ resource gremlinGraph 'Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/gr properties: { resource: { id: name - indexingPolicy: { - automatic: automaticIndexing - } + indexingPolicy: !empty(indexingPolicy) ? indexingPolicy : null partitionKey: { paths: !empty(partitionKeyPaths) ? partitionKeyPaths : null } diff --git a/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/readme.md b/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/readme.md index 64cfdd35f4..fcfedef2ea 100644 --- a/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/readme.md +++ b/modules/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs/readme.md @@ -34,8 +34,8 @@ This module deploys DocumentDB DatabaseAccounts GremlinDatabases Graphs. | Parameter Name | Type | Default Value | Description | | :-- | :-- | :-- | :-- | -| `automaticIndexing` | bool | `True` | Indicates if the indexing policy is automatic. | | `enableDefaultTelemetry` | bool | `True` | Enable telemetry via a Globally Unique Identifier (GUID). | +| `indexingPolicy` | object | `{object}` | Indexing policy of the graph. | | `partitionKeyPaths` | array | `[]` | List of paths using which data within the container can be partitioned. | | `tags` | object | `{object}` | Tags of the Gremlin graph resource. | diff --git a/modules/Microsoft.DocumentDB/databaseAccounts/readme.md b/modules/Microsoft.DocumentDB/databaseAccounts/readme.md index f973849229..18949e53fa 100644 --- a/modules/Microsoft.DocumentDB/databaseAccounts/readme.md +++ b/modules/Microsoft.DocumentDB/databaseAccounts/readme.md @@ -582,14 +582,18 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = { graphs: [ { - automaticIndexing: true + indexingPolicy: { + automatic: true + } name: 'car_collection' partitionKeyPaths: [ '/car_id' ] } { - automaticIndexing: true + indexingPolicy: { + automatic: true + } name: 'truck_collection' partitionKeyPaths: [ '/truck_id' @@ -601,14 +605,18 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = { collections: [ { - automaticIndexing: true + indexingPolicy: { + automatic: true + } name: 'bike_collection' partitionKeyPaths: [ '/bike_id' ] } { - automaticIndexing: true + indexingPolicy: { + automatic: true + } name: 'bicycle_collection' partitionKeyPaths: [ '/bicycle_id' @@ -692,14 +700,18 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = { "graphs": [ { - "automaticIndexing": true, + "indexingPolicy": { + "automatic": true + }, "name": "car_collection", "partitionKeyPaths": [ "/car_id" ] }, { - "automaticIndexing": true, + "indexingPolicy": { + "automatic": true + }, "name": "truck_collection", "partitionKeyPaths": [ "/truck_id" @@ -711,14 +723,18 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = { "collections": [ { - "automaticIndexing": true, + "indexingPolicy": { + "automatic": true + }, "name": "bike_collection", "partitionKeyPaths": [ "/bike_id" ] }, { - "automaticIndexing": true, + "indexingPolicy": { + "automatic": true + }, "name": "bicycle_collection", "partitionKeyPaths": [ "/bicycle_id" @@ -1402,6 +1418,9 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = { containers: [ { + indexingPolicy: { + automatic: true + } kind: 'Hash' name: 'container-001' paths: [ @@ -1491,6 +1510,9 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' = { "containers": [ { + "indexingPolicy": { + "automatic": true + }, "kind": "Hash", "name": "container-001", "paths": [ diff --git a/modules/Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/deploy.bicep b/modules/Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/deploy.bicep index d952eaf912..d79070b826 100644 --- a/modules/Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/deploy.bicep +++ b/modules/Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/deploy.bicep @@ -16,6 +16,9 @@ param tags object = {} @description('Optional. List of paths using which data within the container can be partitioned.') param paths array = [] +@description('Optional. Indexing policy of the container.') +param indexingPolicy object = {} + @description('Optional. Indicates the kind of algorithm used for partitioning.') @allowed([ 'Hash' @@ -54,6 +57,7 @@ resource container 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/container properties: { resource: { id: name + indexingPolicy: !empty(indexingPolicy) ? indexingPolicy : null partitionKey: { paths: paths kind: kind diff --git a/modules/Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/readme.md b/modules/Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/readme.md index cd7deaa823..f23dc4c25d 100644 --- a/modules/Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/readme.md +++ b/modules/Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/readme.md @@ -33,6 +33,7 @@ | Parameter Name | Type | Default Value | Allowed Values | Description | | :-- | :-- | :-- | :-- | :-- | | `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). | +| `indexingPolicy` | object | `{object}` | | Indexing policy of the container. | | `kind` | string | `'Hash'` | `[Hash, MultiHash, Range]` | Indicates the kind of algorithm used for partitioning. | | `paths` | array | `[]` | | List of paths using which data within the container can be partitioned. | | `tags` | object | `{object}` | | Tags of the SQL Database resource. | @@ -80,6 +81,48 @@ tags: {
+### Parameter Usage: `indexingPolicy`
+
+Tag names and tag values can be provided as needed. A tag can be left without a value.
+
+Parameter JSON format
+
+```json
+"indexingPolicy": {
+ "indexingMode": "consistent",
+ "includedPaths": [
+ {
+ "path": "/*"
+ }
+ ],
+ "excludedPaths": [
+ ]
+}
+```
+
+Bicep format
+
+```bicep
+indexingPolicy: {
+ indexingMode: 'consistent'
+ includedPaths: [
+ {
+ path: '/*'
+ }
+ ]
+ excludedPaths: []
+}
+```
+
+
+ ## Outputs | Output Name | Type | Description |