Pulumi provider
Pulumi provider
Kurrent Cloud provides a Pulumi provider, kurrentcloud, to automate the provisioning of KurrentDB clusters and the resources around them: projects, networks, peerings, managed clusters, read-only replica sets, scheduled backups and integrations. The provider is developed in the pulumi-kurrentcloud repository, which also holds its documentation and examples.
Info
The provider was previously published as eventstorecloud. If your stacks use it, see Migrating from eventstorecloud.
Installation
The provider is available for every Pulumi language:
| Language | Install |
|---|---|
| TypeScript/JavaScript | npm install @kurrent/pulumi-kurrentcloud |
| Python | pip install pulumi_kurrentcloud |
| Go | go get github.com/kurrent-io/pulumi-kurrentcloud/sdk/go/kurrentcloud |
| .NET | dotnet add package Kurrent.Pulumi.KurrentCloud |
Each package downloads the provider plugin the first time a program runs. To install the plugin ahead of time, for example in a CI image:
# The latest release
pulumi plugin install resource kurrentcloud --server github://api.github.com/kurrent-io
# A specific release
pulumi plugin install resource kurrentcloud v0.3.1 --server github://api.github.com/kurrent-ioConfiguration
The provider needs the ID of your organization and credentials to act on its behalf. The organization ID is on the organization's settings page in the Cloud console.
For credentials, use either:
- A service account (recommended for automation): set
clientIdandclientSecretto the values from the service account's Authentication tab. When both are set, the provider uses them and ignorestoken. - A token for a Kurrent Cloud account with admin access to the organization: set
token.
Set them with pulumi config:
pulumi config set kurrentcloud:organizationId <organization-id>
# Service account
pulumi config set kurrentcloud:clientId <client-id>
pulumi config set --secret kurrentcloud:clientSecret <client-secret>
# or a token
pulumi config set --secret kurrentcloud:token <token>Or with environment variables, which take the same values:
export ESC_ORG_ID=<organization-id>
export ESC_CLIENT_ID=<client-id>
export ESC_CLIENT_SECRET=<client-secret>
# or
export ESC_TOKEN=<token>Usage
This TypeScript program creates a single-node cluster in an existing project and network, which it looks up by name:
import * as kurrent from "@kurrent/pulumi-kurrentcloud";
const project = kurrent.getProjectOutput({ name: "Default" });
const network = kurrent.getNetworkOutput({ projectId: project.id, name: "My network" });
const cluster = new kurrent.ManagedCluster("cluster", {
name: "my-cluster",
projectId: project.id,
networkId: network.id,
topology: "single-node",
instanceType: "F1",
diskSize: 16,
diskType: "gp3",
diskIops: 3000,
diskThroughput: 125,
serverVersion: "26.0",
});
export const dnsName = cluster.dnsName;Find examples in every language and the full list of resources in the provider repository.
Migrating from eventstorecloud
The eventstorecloud package is replaced by kurrentcloud. Every kurrentcloud resource declares an alias to its old eventstorecloud type, so an existing stack moves to the new package without replacing any cloud resources:
Replace the package with its
kurrentcloudequivalent:Language Old package New package TypeScript/JavaScript @eventstore/pulumi-eventstorecloud@kurrent/pulumi-kurrentcloudPython pulumi_eventstorecloudpulumi_kurrentcloudGo github.com/EventStore/pulumi-eventstorecloud/sdk/go/eventstorecloudgithub.com/kurrent-io/pulumi-kurrentcloud/sdk/go/kurrentcloud.NET Pulumi.EventStoreCloudKurrent.Pulumi.KurrentCloudIf you configure the provider with
pulumi config, move the settings from theeventstorecloud:namespace tokurrentcloud:, for exampleeventstorecloud:organizationIdtokurrentcloud:organizationId. The keys and theESC_*environment variables are unchanged.Run
pulumi previewand check that it shows0 to replacebefore runningpulumi up.
The migration guide covers each language in detail.