Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ module testDeployment '../../deploy.bicep' = {
{
kind: 'Hash'
name: 'container-001'
indexingPolicy: {
automatic: true
}
paths: [
'/myPartitionKey'
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 : []
}
}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. |

Expand Down
38 changes: 30 additions & 8 deletions modules/Microsoft.DocumentDB/databaseAccounts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -1402,6 +1418,9 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' =
{
containers: [
{
indexingPolicy: {
automatic: true
}
kind: 'Hash'
name: 'container-001'
paths: [
Expand Down Expand Up @@ -1491,6 +1510,9 @@ module databaseAccounts './Microsoft.DocumentDB/databaseAccounts/deploy.bicep' =
{
"containers": [
{
"indexingPolicy": {
"automatic": true
},
"kind": "Hash",
"name": "container-001",
"paths": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down Expand Up @@ -80,6 +81,48 @@ tags: {
</details>
<p>

### Parameter Usage: `indexingPolicy`

Tag names and tag values can be provided as needed. A tag can be left without a value.

<details>

<summary>Parameter JSON format</summary>

```json
"indexingPolicy": {
"indexingMode": "consistent",
"includedPaths": [
{
"path": "/*"
}
],
"excludedPaths": [
]
}
```

</details>

<details>

<summary>Bicep format</summary>

```bicep
indexingPolicy: {
indexingMode: 'consistent'
includedPaths: [
{
path: '/*'
}
]
excludedPaths: []
}
```

</details>
<p>

## Outputs

| Output Name | Type | Description |
Expand Down