Define a Terraform Stack with component and deployment configuration files

domain: developer.hashicorp.com/terraform · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a directory for your Stack and add .tfcomponent.hcl files (formerly .tfstack.hcl, renamed at GA) that declare component blocks referencing Terraform modules, input variables, and provider configurations.
  2. Add a .tfdeploy.hcl file that declares one deployment block per environment (e.g., development, production), each specifying the input variable values for that deployment instance.
  3. Reference provider credentials differently per deployment by using variable inputs in the component file and passing environment-specific values in each deployment block.
  4. Connect the Stack to HCP Terraform by creating a Stack resource in your organization pointing to the VCS repository; HCP Terraform supports up to 20 deployments per Stack.
  5. Trigger a Stack plan via the HCP Terraform UI or API; review the plan for each deployment and approve to apply changes across all configured deployments.
  6. Use the orchestrate block in the deployment file to control the order of deployment across environments if you need to deploy development before staging before production.

Known gotchas

Related routes

Manage multi-environment Terraform state with Terragrunt remote_state blocks and path_relative_to_include
terragrunt.gruntwork.io · 6 steps · unrated
Use conftest to policy-test Kubernetes manifests and Terraform plan JSON against Rego policies in a CI pipeline
security/compliance · 5 steps · unrated
Define Terraform for_each with module instances using a map of objects variable to provision per-environment infrastructure with distinct configurations
developer.hashicorp.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans