Skip to content

Get started with Pulumi

The Quant Pulumi provider lets you manage Quant resources in TypeScript or JavaScript. The provider is built from the Quant Terraform provider, so the resources and their arguments match the Terraform resources.

The npm package is @quantcdn/pulumi-quant:

Terminal window
npm install @quantcdn/pulumi-quant

Only the Node.js SDK (TypeScript and JavaScript) is published. The package version follows the Terraform provider version.

Set the API token as a secret and set your organisation:

Terminal window
pulumi config set --secret quant:bearer <your-api-token>
pulumi config set quant:organization <your-organization>
Config key Environment variable Description
quant:bearer QUANTCDN_API_TOKEN API token. Store it as a secret.
quant:organization QUANTCDN_ORGANIZATION Organisation machine name
quant:baseUrl QUANTCDN_BASE_URL Dashboard host for the platform. Set it for QuantGov.

The provider also accepts timeoutSeconds, requestsPerSecond, maxRetries, baseDelayMs, maxDelayMs and enableJitter to tune timeouts and retries.

For a QuantGov project, set baseUrl to the bare dashboard host. The provider adds the API path:

Terminal window
pulumi config set quant:baseUrl https://dash.quantgov.cloud

For QuantCDN, use https://dashboard.quantcdn.io or leave the value unset. See QuantCDN and QuantGov.

import * as quant from "@quantcdn/pulumi-quant";
const site = new quant.Project("example", {
name: "example",
});

Run pulumi up to create the project. Check the resource arguments in the Terraform provider documentation, because the Pulumi arguments use camelCase names for the same fields.

List arguments on rules are plural in Pulumi: domains and urls. Check node_modules/@quantcdn/pulumi-quant/<resource>.d.ts for exact names and types.

On first use Pulumi downloads the provider plugin from GitHub releases, so the machine needs outbound access to github.com.

pulumi import uses the same IDs as terraform import (see the import table):

Terminal window
pulumi import quant:index:Domain www my-project/9555

You can also set { import: "my-project/9555" } in the resource options. Run pulumi preview afterwards and edit the program until it shows no changes.