docs: add remote execution page for Terraform/OpenTofu - #20570
Conversation
|
Your site preview for commit 4073bf9 is ready! 🎉 http://www-testing-pulumi-docs-origin-pr-20570-4073bf99.s3-website.us-west-2.amazonaws.com Changed pages: |
Add a new documentation page covering Pulumi Cloud's remote execution
support for Terraform and OpenTofu workloads. Covers setup with the
cloud {} block, CLI workflows (plan, apply, saved plans, destroy/refresh),
ESC integration with auto-provisioned environments, VCS-triggered runs
via deployment settings, preventative policy enforcement, and HCP
Terraform migration.
Also updates the existing Terraform state backend page:
- Adds remote execution callout in the "How it works" section
- Updates drift detection FAQ (remote exec available, drift not yet)
- Updates preventative policies FAQ and notes (now available with remote exec)
Co-Authored-By: Claude <noreply@anthropic.com>
cnunciato
left a comment
There was a problem hiding this comment.
This is great! A few questions and suggestions from me, but otherwise seems good to go. Leaving you an approval to keep you unblocked.
| ### Can I use drift detection with Terraform-managed stacks? | ||
|
|
||
| Not currently. Drift detection and [Pulumi Deployments](/docs/pulumi-cloud/deployments/) require a Pulumi program to execute. If you want these features, you can [convert your Terraform code to Pulumi](/docs/iac/get-started/terraform/convert-hcl/) and then run updates with the Pulumi CLI. | ||
| Not currently. Drift detection requires a Pulumi program. If you want this feature, you can [convert your Terraform code to Pulumi](/docs/iac/get-started/terraform/convert-hcl/) and run updates with the Pulumi CLI. |
There was a problem hiding this comment.
This would work for Pulumi HCL though, right? (If so, maybe a mention of that also.)
|
|
||
| Remote execution gives you: | ||
|
|
||
| - **Consistent environment** — every plan and apply runs in the same managed infrastructure, not on individual developer machines |
There was a problem hiding this comment.
Should we mention approvals in this list?
| aliases: | ||
| --- | ||
|
|
||
| Pulumi Cloud can run your Terraform and OpenTofu operations remotely. Instead of running `plan` and `apply` on your local machine, the Terraform or OpenTofu CLI uploads your configuration to Pulumi Cloud, which executes the operation in a managed container and streams the output back to your terminal in real time. |
There was a problem hiding this comment.
Would it be worth mentioning something about how this is designed to work like HCP Terraform and TFE?
|
|
||
| ## How it works | ||
|
|
||
| When you run `terraform plan` or `terraform apply` against a Pulumi Cloud workspace with remote execution enabled: |
There was a problem hiding this comment.
| When you run `terraform plan` or `terraform apply` against a Pulumi Cloud workspace with remote execution enabled: | |
| When you run `terraform plan` or `terraform apply` against a Pulumi Cloud workspace with [remote execution enabled](#enable-remote-execution): |
|
|
||
| ## How it works | ||
|
|
||
| When you run `terraform plan` or `terraform apply` against a Pulumi Cloud workspace with remote execution enabled: |
There was a problem hiding this comment.
Are we calling these "workspaces", or "stacks"? They're technically stacks, right? (If so, maybe mention that the concepts are similar and that we call them stacks in Pulumi, then replace the "workspace" mentions throughout.)
|
|
||
| {{< /chooser >}} | ||
|
|
||
| The saved plan file is a bookmark — the actual plan artifact is stored securely in Pulumi Cloud. When you apply the bookmark, Pulumi Cloud uses the original saved plan, guaranteeing that the apply matches exactly what you reviewed even if infrastructure drifted in the meantime. |
There was a problem hiding this comment.
Is it worth conveying how it's (presumably) scoped to this particular stack? Do successive plans run against this stack overwrite each other? 🤔
|
|
||
| 1. Follow the [HCP Terraform state migration steps](/docs/iac/get-started/terraform/terraform-state-backend/#migrate-from-hcp-terraform-terraform-cloud) to move your state. | ||
| 1. Update your `cloud` block to point at Pulumi Cloud (change `hostname` and `organization`). | ||
| 1. Add your cloud credentials to the stack's [automatically provisioned ESC environment](#provide-credentials-with-esc) to replace workspace variables. |
There was a problem hiding this comment.
Would it make sense to mention anything about Vault integration here?
|
|
||
| ### Is drift detection available? | ||
|
|
||
| Not currently for Terraform-managed stacks. You can run `terraform plan` on a schedule via CI/CD to detect drift manually. |
There was a problem hiding this comment.
Should we mention that you can do this (assuming you actually can) through our HCL language support?
Per the companion docs PR (#20570), new stacks created through the Terraform or OpenTofu CLI default to remote execution; existing stacks enable it with a stack tag. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Summary
/docs/iac/get-started/terraform/terraform-remote-execution/covering Pulumi Cloud's remote execution support for Terraform and OpenTofu workloadsNew page covers
cloud {}block (and note thatbackend "remote"also works)TF_VAR_*conventionterraform:execution-modestack tagTest plan
make lintpassesmake buildpasses🤖 Generated with Claude Code
Co-Authored-By: Claire Gaestel claire@pulumi.com