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.
Install
Section titled “Install”The npm package is @quantcdn/pulumi-quant:
npm install @quantcdn/pulumi-quantOnly the Node.js SDK (TypeScript and JavaScript) is published. The package version follows the Terraform provider version.
Configure the provider
Section titled “Configure the provider”Set the API token as a secret and set your organisation:
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.
QuantGov
Section titled “QuantGov”For a QuantGov project, set baseUrl to the bare dashboard host. The provider adds the API path:
pulumi config set quant:baseUrl https://dash.quantgov.cloudFor QuantCDN, use https://dashboard.quantcdn.io or leave the value unset. See QuantCDN and QuantGov.
Create a resource
Section titled “Create a resource”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.
Import existing resources
Section titled “Import existing resources”pulumi import uses the same IDs as terraform import (see the import table):
pulumi import quant:index:Domain www my-project/9555You can also set { import: "my-project/9555" } in the resource options. Run pulumi preview afterwards and edit the program until it shows no changes.
