From f7d6652254d13b0b6673548435265401cd187964 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Tue, 4 Aug 2026 15:30:50 +0200 Subject: [PATCH] document usage of Plural Terraform provider from Pulumi --- generated/routes.json | 18 +++-- .../{terraform.md => terraform/index.md} | 4 +- pages/api-reference/terraform/pulumi.md | 68 +++++++++++++++++++ .../stacks-iac-management/index.md | 2 +- .../stacks-iac-management/pulumi.md | 2 + src/markdoc/tags/doclink.tsx | 2 + src/routing/docs-structure.ts | 1 + 7 files changed, 87 insertions(+), 10 deletions(-) rename pages/api-reference/{terraform.md => terraform/index.md} (96%) create mode 100644 pages/api-reference/terraform/pulumi.md diff --git a/generated/routes.json b/generated/routes.json index efbf68e5..e1a61111 100644 --- a/generated/routes.json +++ b/generated/routes.json @@ -120,8 +120,12 @@ "lastmod": null }, "/api-reference/terraform": { - "relPath": "/api-reference/terraform.md", - "lastmod": "2026-02-03T22:03:47.000Z" + "relPath": "/api-reference/terraform/index.md", + "lastmod": "2026-08-04T13:27:26.025Z" + }, + "/api-reference/terraform/pulumi": { + "relPath": "/api-reference/terraform/pulumi.md", + "lastmod": "2026-08-04T13:27:26.046Z" }, "/plural-features": { "relPath": "/plural-features/index.md", @@ -153,11 +157,11 @@ }, "/plural-features/continuous-deployment/service-templating": { "relPath": "/plural-features/continuous-deployment/service-templating/index.md", - "lastmod": "2026-07-14T13:15:49.255Z" + "lastmod": "2026-08-04T13:27:26.172Z" }, "/plural-features/continuous-deployment/service-templating/supporting-liquid-filters": { "relPath": "/plural-features/continuous-deployment/service-templating/supporting-liquid-filters.md", - "lastmod": "2026-07-14T13:15:49.275Z" + "lastmod": "2026-08-04T13:27:26.192Z" }, "/plural-features/continuous-deployment/lua": { "relPath": "/plural-features/continuous-deployment/lua.md", @@ -201,7 +205,7 @@ }, "/plural-features/stacks-iac-management": { "relPath": "/plural-features/stacks-iac-management/index.md", - "lastmod": "2025-03-12T14:59:41.000Z" + "lastmod": "2026-07-15T09:31:13.000Z" }, "/plural-features/stacks-iac-management/customize-runners": { "relPath": "/plural-features/stacks-iac-management/customize-runners.md", @@ -209,7 +213,7 @@ }, "/plural-features/stacks-iac-management/pulumi": { "relPath": "/plural-features/stacks-iac-management/pulumi.md", - "lastmod": "2026-07-14T13:15:49.496Z" + "lastmod": "2026-07-15T09:31:13.000Z" }, "/plural-features/stacks-iac-management/pr-workflow": { "relPath": "/plural-features/stacks-iac-management/pr-workflow.md", @@ -593,7 +597,7 @@ }, "/deployments/stacks": { "relPath": "/plural-features/stacks-iac-management/index.md", - "lastmod": "2025-03-12T14:59:41.000Z" + "lastmod": "2026-07-15T09:31:13.000Z" }, "/service-catalog/creation": { "relPath": "/plural-features/service-catalog/creation.md", diff --git a/pages/api-reference/terraform.md b/pages/api-reference/terraform/index.md similarity index 96% rename from pages/api-reference/terraform.md rename to pages/api-reference/terraform/index.md index cd8df525..88566177 100644 --- a/pages/api-reference/terraform.md +++ b/pages/api-reference/terraform/index.md @@ -8,7 +8,7 @@ description: >- For ingesting clusters or creating net new infrastructure, our terraform provider is usually the most natural surface for integrating Plural with your existing processes or adopting a full IaC based infrastructure management approach from the ground up. -Our provider is available on the Terraform Registry's [Plural Provider page](https://registry.terraform.io/providers/pluralsh/plural/latest/docs) +Our provider is available on the Terraform Registry's [Plural Provider page](https://registry.terraform.io/providers/pluralsh/plural/latest/docs). It can also be used from Pulumi — see [Using from Pulumi](/api-reference/terraform/pulumi). You can see snippets throughout our getting started guides, but some common usecases are as follows: @@ -111,4 +111,4 @@ local { externaldns_context = jsondecode(data.plural_service_context.externaldns.configuration) # it is json encoded coming from our api external_dns_arn = local.externaldns_context.roleArn } -``` \ No newline at end of file +``` diff --git a/pages/api-reference/terraform/pulumi.md b/pages/api-reference/terraform/pulumi.md new file mode 100644 index 00000000..448dd36f --- /dev/null +++ b/pages/api-reference/terraform/pulumi.md @@ -0,0 +1,68 @@ +--- +title: Using from Pulumi +description: >- + Use the Plural Terraform provider from Pulumi via the Any Terraform Provider bridge +--- + +Pulumi can consume the same [`pluralsh/plural`](https://registry.terraform.io/providers/pluralsh/plural) Terraform provider through the [Any Terraform Provider](https://www.pulumi.com/docs/iac/concepts/providers/any-terraform-provider/) bridge. There is no separate package on PyPI or npm — the SDK is generated locally in your project. + +```bash +pulumi new python # or typescript, go, etc. +pulumi package add terraform-provider pluralsh/plural +pulumi install +``` + +Pin `` for reproducible builds (recommended), or omit it to use the latest registry release. + +Credentials (either): + +* `plural cd login`, then `use_cli=True` / `PLURAL_USE_CLI=true` +* `PLURAL_CONSOLE_URL` + `PLURAL_ACCESS_TOKEN` + +Optional kubeconfig at `~/.kube/config` for agent install. See also [Configuring the Provider](/api-reference/terraform#configuring-the-provider). + +```bash +pulumi preview +pulumi up +``` + +## Example + +Python equivalent of a Terraform `plural_cluster`: + +```python +import pulumi +import pulumi_plural as plural + +provider = plural.Provider("plural", use_cli=True) +opts = pulumi.ResourceOptions(provider=provider) + +default_project = plural.get_project( + name="default", + opts=pulumi.InvokeOptions(provider=provider), +) + +cluster = plural.Cluster( + "test", + name="test-cluster", + handle="test", + project_id=default_project.id, + opts=opts, +) + +pulumi.export("cluster_id", cluster.id) +``` + +| Terraform | Pulumi Python | +| --- | --- | +| `provider "plural"` | `plural.Provider(...)` | +| `plural_cluster` | `plural.Cluster` | +| `data.plural_project` | `plural.get_project(...)` | +| `use_cli` | `use_cli` | +| `kubeconfig.config_path` | `ProviderKubeconfigArgs(config_path=...)` | + +See [pluralsh/pulumi-plural](https://github.com/pluralsh/pulumi-plural) for a fuller example. + +{% callout severity="info" %} +To run Pulumi programs through Plural Stacks, create an `InfrastructureStack` with `type: PULUMI` (see [Pulumi stacks](/plural-features/stacks-iac-management/pulumi)). +{% /callout %} diff --git a/pages/plural-features/stacks-iac-management/index.md b/pages/plural-features/stacks-iac-management/index.md index d040a65d..f5bacc8b 100644 --- a/pages/plural-features/stacks-iac-management/index.md +++ b/pages/plural-features/stacks-iac-management/index.md @@ -24,7 +24,7 @@ To get a better idea of the full power of the experience, feel free to take a lo | `ANSIBLE` | Ansible playbooks | | `CUSTOM` | A custom runner image and command workflow | -Pulumi stacks use Pulumi's own state backends. See {% doclink to="plural_features_stacks_iac_management_pulumi" %}Pulumi stacks{% /doclink %} for Pulumi Cloud and self-managed backend authentication. +Pulumi stacks use Pulumi's own state backends. See [Pulumi stacks](/plural-features/stacks-iac-management/pulumi) for Pulumi Cloud and self-managed backend authentication. To drive Console resources from Pulumi via the Terraform provider, see [Using from Pulumi](/api-reference/terraform/pulumi). # A Basic Stack diff --git a/pages/plural-features/stacks-iac-management/pulumi.md b/pages/plural-features/stacks-iac-management/pulumi.md index f2ec6a5e..edb2477c 100644 --- a/pages/plural-features/stacks-iac-management/pulumi.md +++ b/pages/plural-features/stacks-iac-management/pulumi.md @@ -32,6 +32,8 @@ spec: `configuration.pulumi.stack` defaults to `dev`. Omit `backendUrl` to use Pulumi Cloud, or set it to a Pulumi-supported self-managed backend URL. Unlike Terraform, `manageState` does not manage Pulumi state; configure the state backend with `backendUrl`. +For using the Plural Terraform provider from a Pulumi program, see [Using from Pulumi](/api-reference/terraform/pulumi). + ## Pulumi Cloud Pulumi Cloud is the default backend. Authenticate the runner with a `PULUMI_ACCESS_TOKEN` sourced from a Kubernetes Secret in the same namespace as the `InfrastructureStack`. diff --git a/src/markdoc/tags/doclink.tsx b/src/markdoc/tags/doclink.tsx index e993d016..efa62747 100644 --- a/src/markdoc/tags/doclink.tsx +++ b/src/markdoc/tags/doclink.tsx @@ -88,6 +88,8 @@ const oldDocIDtoRouteMap: Record = { '/plural-features/k8s-upgrade-assistant/upgrade-insights', plural_features_stacks_iac_management: '/plural-features/stacks-iac-management', + plural_features_stacks_iac_management_pulumi: + '/plural-features/stacks-iac-management/pulumi', plural_features_stacks_iac_management_customize_runners: '/plural-features/stacks-iac-management/customize-runners', plural_features_stacks_iac_management_pr_workflow: diff --git a/src/routing/docs-structure.ts b/src/routing/docs-structure.ts index f9f333b9..175ac415 100644 --- a/src/routing/docs-structure.ts +++ b/src/routing/docs-structure.ts @@ -100,6 +100,7 @@ export const docsStructure: DocSection[] = [ { path: 'terraform', title: 'Terraform Provider reference', + sections: [{ path: 'pulumi', title: 'Using from Pulumi' }], }, ], },