-
Notifications
You must be signed in to change notification settings - Fork 437
[Modules] Added CosmosDB Gremlin API and updated mongodb to… #1566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AlexanderSehr
merged 7 commits into
Azure:users/itpropro/gremlin
from
itpropro:feature/gremlin
Jul 6, 2022
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9a68815
feat(document-db): Added CosmosDB Gremlin API and updated mongodb to…
itpropro 4c30f67
docs(graphs): Updated readme.md
itpropro feca994
feat(document-db): Added backupPolicy, updated docs
itpropro f48ed7f
Update arm/Microsoft.DocumentDB/databaseAccounts/deploy.bicep
itpropro 7fae79e
feat(gremlin-databases): Added tests and small bugfixes
itpropro e91ede0
feat(gremlin): Updated tests, pipeline, parameters
itpropro 3db6236
refactor(test): Changed .parameters to .test
itpropro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
arm/Microsoft.DocumentDB/databaseAccounts/.test/gremlindb.parameters.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| { | ||
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
| "contentVersion": "1.0.0.0", | ||
| "parameters": { | ||
| "name": { | ||
| "value": "<<namePrefix>>-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": [ | ||
| "<<deploymentSpId>>" | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| "gremlinDatabases": { | ||
| "value": [ | ||
| { | ||
| "name": "<<namePrefix>>-az-gdb-x-001", | ||
| "graphs": [ | ||
| { | ||
| "name": "car_collection", | ||
| "automaticIndexing": true, | ||
| "partitionKeyPaths": [ | ||
| "/car_id" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "truck_collection", | ||
| "automaticIndexing": true, | ||
| "partitionKeyPaths": [ | ||
| "/truck_id" | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "<<namePrefix>>-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/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<<namePrefix>>azsax001" | ||
| }, | ||
| "diagnosticWorkspaceId": { | ||
| "value": "/subscriptions/<<subscriptionId>>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<<namePrefix>>-az-law-x-001" | ||
| }, | ||
| "diagnosticEventHubAuthorizationRuleId": { | ||
| "value": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<<namePrefix>>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" | ||
| }, | ||
| "diagnosticEventHubName": { | ||
| "value": "adp-<<namePrefix>>-az-evh-x-001" | ||
| }, | ||
| "systemAssignedIdentity": { | ||
| "value": true | ||
| } | ||
| } | ||
| } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
arm/Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/deploy.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.