Skip to content

feat: Stacks Pulumi support - #3820

Merged
maciaszczykm merged 25 commits into
masterfrom
marcin/prod-4659-stacks-pulumi-support
Jul 15, 2026
Merged

feat: Stacks Pulumi support#3820
maciaszczykm merged 25 commits into
masterfrom
marcin/prod-4659-stacks-pulumi-support

Conversation

@maciaszczykm

@maciaszczykm maciaszczykm commented Jul 9, 2026

Copy link
Copy Markdown
Member

Similar to #3631 which added support for Terragrunt.

Documentation added in pluralsh/documentation#611.

Test Plan

Repository with samples: https://github.com/pluralsh/pulumi-samples
Test environment: https://console.plrl-dev-aws.onplural.sh/
Console, controller and agent image tag: sha-10ecf45

Zrzut ekranu 2026-07-14 o 14 51 14 Zrzut ekranu 2026-07-14 o 14 51 39 Zrzut ekranu 2026-07-14 o 14 51 27 Zrzut ekranu 2026-07-14 o 15 07 25 Zrzut ekranu 2026-07-14 o 15 07 37 Zrzut ekranu 2026-07-14 o 15 09 42

Checklist

  • I have added a meaningful title and summary to convey the impact of this PR to a user.
  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have deployed the agent to a test environment and verified that it works as expected (required only when changing agent code).

Plural Flow: console

@linear

linear Bot commented Jul 9, 2026

Copy link
Copy Markdown

PROD-4659

@soffi-ai

soffi-ai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Soffi AI Summary

This PR adds Pulumi as a first-class IaC stack type in Plural Console, following the same pattern established by the earlier Terragrunt support. It introduces end-to-end support across all layers of the stack — server, controller, deployment agent harness, Go client, and React frontend.

Key changes by layer:

  • Elixir server & GraphQL schema: New PulumiConfiguration type (with fields for stack, backendUrl, parallel, refresh, approveEmpty) is added to StackConfiguration and StackOverrides. A new PULUMI enum value is added to StackType. Validation is added to reject Pulumi stacks that specify a policy engine (incompatible combination).

  • Go controller (go/controller/): InfrastructureStack and StackDefinition CRD types gain a PulumiConfiguration struct and field. CRD YAML manifests (both in go/controller/config/crd/ and charts/controller/crds/) are regenerated to include the new Pulumi fields. Deepcopy methods are generated. Unit tests are added for the new stack type.

  • Go client (go/client/): GraphQL operations and models are updated/regenerated to include PulumiConfiguration and the new StackType enum value. Persisted queries are updated accordingly.

  • Deployment operator harness (go/deployment-operator/): A new CD workflow (deployment-operator-cd-harness.yaml) for the Pulumi harness image is added, enabling the agent to execute Pulumi stack runs (preview, up, destroy). Fixes include nil pointer dereference handling, ensuring the Pulumi home directory, passing env vars to pulumi stack export, using preview mode during up, and supporting a configurable backend URL via pulumi login.

  • React frontend (assets/): The stack configuration UI is extended with a Pulumi-specific settings panel (stack name, backend URL, parallelism, refresh, approve-empty options). A PulumiLogoIcon is added to the design system. Stack type utilities and the type icon component are updated to recognize PULUMI. New GraphQL fragments and queries for Pulumi configuration are added and codegen-regenerated.

  • Docker/CI: The Dockerfile base image is bumped, and the harness CD workflow is wired up for Pulumi alongside the existing Terraform/Terragrunt/Ansible harnesses. Agent/sentinel harness workflows are updated to reflect related image tag changes.

The feature was validated end-to-end using sample Pulumi programs in a dedicated test repo against a live Console environment.

Commits

Commit Summary

Deploy in Soffi


Updated: 2026-07-15 09:32 UTC

@maciaszczykm maciaszczykm added the enhancement New feature or request label Jul 10, 2026
@socket-security

socket-security Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​types/​node@​22.20.0 ⏵ 24.10.1100 +110081 +196100

View full report

@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds Pulumi as a supported IaC tool in the stacks harness, following the same structure introduced for Terragrunt. The implementation covers the full lifecycle: backend login, stack selection, config variable injection, dependency installation, preview, apply, destroy, state export, output collection, and secret detection.

  • Go harness (pkg/harness/tool/pulumi/): New Pulumi tool wiring together Prepare, four ArgsModifier types, State/Output via pulumi stack export/output --json, and HasChanges via pulumi preview --json. The previously raised missing-env-in-stackExport and nil-Run-dereference issues are both resolved.
  • Elixir layer: Adds pulumi: 4 enum, Pulumi configuration embed, policy-engine validation guard, and three-clause pulumi_commands/2 consistent with the modifier expectations.
  • CRD & controller: New PulumiConfiguration type; Validate() blocks policy-engine use on Pulumi stacks at admission time.

Confidence Score: 5/5

Safe to merge — the new Pulumi tool is well-structured and the prior issues are all resolved in this version.

The implementation correctly handles the full Pulumi lifecycle with proper env propagation, nil guards, and plan-file threading. All prior blocking issues are resolved. Two minor observations remain but neither affects runtime correctness.

No files require special attention.

Important Files Changed

Filename Overview
go/deployment-operator/pkg/harness/tool/pulumi/pulumi.go New Pulumi tool implementation. The stackExport env fix and nil-run guard are correctly in place. Minor: installDependencies uses raw osexec.Command for go mod download (no timeout, no exec-level logging) inconsistently with the npm path.
go/deployment-operator/pkg/harness/tool/pulumi/modifier.go Four ArgsModifier implementations. UpArgsModifier now correctly appends --plan planFile. Logic for idempotent flag injection is correct.
go/deployment-operator/dockerfiles/harness/pulumi.Dockerfile New Pulumi harness image with SHA256-verified binary download. Python omitted and documented.
go/deployment-operator/pkg/harness/controller/controller_hooks.go Adds Prepare() call in preStart(). Scan() errors remain klog.ErrorS (non-fatal), consistent with prior behavior.
go/deployment-operator/pkg/harness/stackrun/v1/types.go Adds Parallel, PulumiStack, PulumiBackendURL, Deleted fields. Deleted correctly derives from Stack.DeletedAt.
go/controller/api/v1alpha1/infrastructurestack_types.go Adds PulumiConfiguration and Validate() blocking policyEngine on PULUMI stacks. Both Go and Elixir layers enforce this.
lib/console/deployments/stacks/commands.ex Adds pulumi_commands/2 with three clauses matching modifier expectations.
lib/console/schema/stack.ex Adds pulumi: 4 enum, Pulumi embed, and validate_policy_engine/1 guard.
go/deployment-operator/pkg/harness/tool/pulumi/pulumi_test.go Good coverage: HasChanges, Output secret redaction, configureVariables type mapping, Prepare env propagation, and nil-Run constructor.

Reviews (7): Last reviewed commit: "update persisted queries with new operat..." | Re-trigger Greptile

Comment thread go/deployment-operator/pkg/harness/tool/pulumi/modifier.go
Comment thread go/deployment-operator/pkg/harness/tool/pulumi/pulumi.go Outdated
Comment thread go/deployment-operator/dockerfiles/harness/pulumi.Dockerfile
@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

@maciaszczykm
maciaszczykm force-pushed the marcin/prod-4659-stacks-pulumi-support branch from 817d4d6 to 659ca45 Compare July 10, 2026 14:13
@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

Comment thread go/deployment-operator/pkg/harness/tool/pulumi/pulumi.go
@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

@maciaszczykm
maciaszczykm marked this pull request as ready for review July 14, 2026 13:31
@maciaszczykm
maciaszczykm requested a review from a team as a code owner July 14, 2026 13:31
Comment thread go/deployment-operator/pkg/harness/controller/controller_hooks.go
@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

@maciaszczykm
maciaszczykm requested a review from a team July 14, 2026 14:23

@michaeljguarino michaeljguarino left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will the pulumi code need a specific go version if it's go based? Probably not a huge issue since node is probably our best target here, but worth thinking about.

@maciaszczykm

Copy link
Copy Markdown
Member Author

@michaeljguarino Added a ticket to investigate it.

@maciaszczykm
maciaszczykm merged commit fc037ec into master Jul 15, 2026
108 of 110 checks passed
@maciaszczykm
maciaszczykm deleted the marcin/prod-4659-stacks-pulumi-support branch July 15, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants