I am trying to setup an Azure CosmosDB GremlinGrap...
# azure
g
I am trying to setup an Azure CosmosDB GremlinGraph as documented here: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/azure/cosmosdb/#GremlinGraph However the TS property "GremlinGraph" does not exist. I am using Pulumi v1.8.1 My package.json:
Copy code
{
    "name": "azure-typescript",
    "devDependencies": {
        "@types/node": "^8.0.0"
    },
    "dependencies": {
        "@pulumi/pulumi": "^1.0.0",
        "@pulumi/azure": "^1.0.0",
        "@pulumi/kubernetes": "^1.0.0",
        "@pulumi/azuread": "^1.0.0"
    }
}
b
What version of Pulumi-azure is in your lock file? This new parameter was just added as of Pulumi-azure 1.10 AFAICR
g
Both package lock and "npm ls" showing 1.10
Copy code
"resolved": "<https://registry.npmjs.org/@pulumi/azure/-/azure-1.10.0.tgz>",
@pulumi/azure@1.10.0
Just downloaded the TAR archive using "wget" and listed all the files with "tar tf":
Copy code
$ tar tf azure-1.10.0.tgz | grep -i gremlin
package/cosmosdb/gremlinDatabase.d.ts
package/cosmosdb/gremlinDatabase.js
package/cosmosdb/gremlinDatabase.js.map
b
@great-analyst-59265 my apologies here - I thought it was the gremlin database - therefore, you need pulumi-azure 1.11.0 to use the gremlinGraph
g
@broad-dog-22463 thank you for your help, works like charm. Here's what I did: 1. npm update 2. Applied the following:
Copy code
import * as azure from "@pulumi/azure";
import * as config from "./config";

const cosmosDb = new azure.cosmosdb.Account("cosmosDb", {
    resourceGroupName: config.resourceGroup.name,
    location: config.location,
    kind: "GlobalDocumentDB",
    offerType: "Standard",
    capabilities: [{name: "EnableGremlin"}],
    enableAutomaticFailover: false,
    enableMultipleWriteLocations: false,
    consistencyPolicy: {
        consistencyLevel: "Session",
        maxIntervalInSeconds: 5,
        maxStalenessPrefix: 100,
    },
    geoLocations: [
        {
            failoverPriority: 0,
            location: config.location,
        },
    ],
});

const gremlinDb = new azure.cosmosdb.GremlinDatabase("db", {
    resourceGroupName: cosmosDb.resourceGroupName,
    accountName: cosmosDb.name,
    throughput: 400,
});

export const gremlinGraph = new azure.cosmosdb.GremlinGraph("graph", {
    resourceGroupName: cosmosDb.resourceGroupName,
    accountName: cosmosDb.name,
    databaseName: gremlinDb.name,
    throughput: 400,
    conflictResolutionPolicies: [{
        conflictResolutionPath: "/_ts",
        mode: "LastWriterWins",
    }],
    indexPolicies: [{
        automatic: true,
        excludedPaths: ["/\"_etag\"/?"],
        includedPaths: ["/*"],
        indexingMode: "Consistent",
    }],
    partitionKeyPath: "/partkey",
});
b
Glad it worked! Sorry for the incorrect information earlier