Azure CosmosDB (DocumentDB) Gremlin Graph
This page shows how to write Terraform and Azure Resource Manager for CosmosDB (DocumentDB) Gremlin Graph and write them securely.
azurerm_cosmosdb_gremlin_graph (Terraform)
The Gremlin Graph in CosmosDB (DocumentDB) can be configured in Terraform with the resource name azurerm_cosmosdb_gremlin_graph. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_cosmosdb_gremlin_graph" "serverless" {
name = "tfex-cosmos-gremlin-graph"
resource_group_name = azurerm_cosmosdb_account.example.resource_group_name
account_name = azurerm_cosmosdb_account.example.name
database_name = azurerm_cosmosdb_gremlin_database.example.name
partition_key_path = "/Example"
resource "azurerm_cosmosdb_gremlin_graph" "serverless" {
name = "tfex-cosmos-gremlin-graph"
resource_group_name = azurerm_cosmosdb_account.example.resource_group_name
account_name = azurerm_cosmosdb_account.example.name
database_name = azurerm_cosmosdb_gremlin_database.example.name
partition_key_path = "/Example"
resource "azurerm_cosmosdb_gremlin_graph" "graph" {
name = var.settings.name
resource_group_name = var.resource_group_name
account_name = var.cosmosdb_account_name
database_name = var.gremlin_database_name
partition_key_path = var.settings.partition_key_path
resource "azurerm_cosmosdb_gremlin_graph" "graph" {
name = var.settings.name
resource_group_name = var.resource_group_name
account_name = var.cosmosdb_account_name
database_name = var.gremlin_database_name
partition_key_path = var.settings.partition_key_path
resource "azurerm_cosmosdb_gremlin_graph" "graph" {
name = var.settings.name
resource_group_name = var.resource_group_name
account_name = var.cosmosdb_account_name
database_name = var.gremlin_database_name
partition_key_path = var.settings.partition_key_path
resource "azurerm_cosmosdb_gremlin_graph" "graph" {
name = var.settings.name
resource_group_name = var.resource_group_name
account_name = var.cosmosdb_account_name
database_name = var.gremlin_database_name
partition_key_path = var.settings.partition_key_path
resource "azurerm_cosmosdb_gremlin_graph" "this" {
account_name = var.account_name
database_name = var.database_name
name = var.name
partition_key_path = var.partition_key_path
resource_group_name = var.resource_group_name
resource "azurerm_cosmosdb_gremlin_graph" "skillsmatrix" {
name = "skills-matrix-graph"
resource_group_name = azurerm_cosmosdb_account.skillsmatrix.resource_group_name
account_name = azurerm_cosmosdb_account.skillsmatrix.name
database_name = azurerm_cosmosdb_gremlin_database.skillsmatrix.name
partition_key_path = "/Company"
resource "azurerm_cosmosdb_gremlin_graph" "graph" {
name = var.settings.name
resource_group_name = var.resource_group_name
account_name = var.cosmosdb_account_name
database_name = var.gremlin_database_name
partition_key_path = var.settings.partition_key_path
resource "azurerm_cosmosdb_gremlin_graph" "this" {
account_name = var.account_name
database_name = var.database_name
name = var.name
partition_key_path = var.partition_key_path
resource_group_name = var.resource_group_name
Parameters
-
account_namerequired - string -
database_namerequired - string -
default_ttloptional computed - number -
idoptional computed - string -
namerequired - string -
partition_key_pathoptional - string -
resource_group_namerequired - string -
throughputoptional computed - number -
autoscale_settingslist block-
max_throughputoptional computed - number
-
-
conflict_resolution_policylist block-
conflict_resolution_pathoptional - string -
conflict_resolution_procedureoptional - string -
moderequired - string
-
-
index_policylist block-
automaticoptional - bool -
excluded_pathsoptional - set of string -
included_pathsoptional - set of string -
indexing_moderequired - string
-
-
timeoutssingle block -
unique_keyset block-
pathsrequired - set of string
-
Explanation in Terraform Registry
Manages a Gremlin Graph within a Cosmos DB Account.
Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs (Azure Resource Manager)
The databaseAccounts/gremlinDatabases/graphs in Microsoft.DocumentDB can be configured in Azure Resource Manager with the resource name Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
apiVersionrequired - stringlocationoptional - stringThe location of the resource group to which the resource belongs.
namerequired - stringCosmos DB graph name.
propertiesrequiredoptionsoptionalautoscaleSettingsoptionalmaxThroughputoptional - integerRepresents maximum throughput, the resource can scale up to.
throughputoptional - integerRequest Units per second. For example, "throughput": 10000.
resourcerequiredconflictResolutionPolicyoptionalconflictResolutionPathoptional - stringThe conflict resolution path in the case of LastWriterWins mode.
conflictResolutionProcedureoptional - stringThe procedure to resolve conflicts in the case of custom mode.
modeoptional - stringIndicates the conflict resolution mode.
defaultTtloptional - integerDefault time to live
idrequired - stringName of the Cosmos DB Gremlin graph
indexingPolicyoptionalautomaticoptional - booleanIndicates if the indexing policy is automatic
compositeIndexesoptional - arrayList of composite path list
excludedPathsoptional arraypathoptional - stringThe path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
includedPathsoptional arrayindexesoptional arraydataTypeoptional - stringThe datatype for which the indexing behavior is applied to.
kindoptional - stringIndicates the type of index.
precisionoptional - integerThe precision of the index. -1 is maximum precision.
pathoptional - stringThe path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
indexingModeoptional - stringIndicates the indexing mode.
spatialIndexesoptional arraypathoptional - stringThe path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
typesoptional - arrayList of path's spatial type
partitionKeyoptionalkindoptional - stringIndicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create.
pathsoptional - arrayList of paths using which data within the container can be partitioned
versionoptional - integerIndicates the version of the partition key definition
uniqueKeyPolicyoptionaluniqueKeysoptional arraypathsoptional - arrayList of paths must be unique for each document in the Azure Cosmos DB service
tagsoptional - stringTags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
typerequired - string
Frequently asked questions
What is Azure CosmosDB (DocumentDB) Gremlin Graph?
Azure CosmosDB (DocumentDB) Gremlin Graph is a resource for CosmosDB (DocumentDB) of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure CosmosDB (DocumentDB) Gremlin Graph?
For Terraform, the gilyas/infracost, infracost/infracost and anmoltoppo/Terraform source code examples are useful. See the Terraform Example section for further details.