terraform-stacks

Create, validate, and deploy Terraform Stack configurations across environments and regions.

Updated Jun 13, 2026
One-click install
npx skills add https://github.com/jenreh/project-kit-template --skill terraform-stacks-jenreh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-stacks
Source: https://github.com/jenreh/project-kit-template/tree/main/.agents/agent-skills/skills/terraform-stacks
Command: npx skills add https://github.com/jenreh/project-kit-template --skill terraform-stacks-jenreh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing infrastructure at scale with traditional Terraform modules becomes unwieldy when coordinating multiple components across environments, regions, and cloud accounts. This Skill provides complete guidance for authoring and operating Terraform Stacks, the HCL-based configuration layer above Terraform modules. ## Core Features & Use Cases - Stack Configuration Authoring: Write .tfcomponent.hcl files with variables, providers, components, outputs, and removed blocks, sourcing modules from local paths, public registries, private registries, or Git. - Deployment Orchestration: Define .tfdeploy.hcl deployments with OIDC identity tokens, deployment groups, auto-approve rules, and linked Stacks via publish_output and upstream_input blocks. - Programmatic Monitoring: Monitor deployment runs through the HCP Terraform API, retrieve error diagnostics with file locations, and extract Stack outputs from apply artifacts. - Use Case: Deploy a production application across three AWS regions by defining a multi-region provider with for_each, regional components, and a single deployment, then monitor the rollout via API polling in CI/CD. ## Quick Start Ask the AI to create a Terraform Stack with a VPC component and separate development and production deployments using workload identity authentication.

Frequently Asked Questions about terraform-stacks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Terraform Stack with multiple deployments?

Define components in .tfcomponent.hcl files referencing modules, then create deployment blocks in .tfdeploy.hcl with environment-specific inputs. Stacks support 1 to 20 deployments, each with isolated state for dev, staging, and production environments.

How do Terraform Stacks differ from Terraform modules?

Stacks are a configuration layer above modules using a separate HCL language with .tfcomponent.hcl and .tfdeploy.hcl files. Components wrap modules, providers support for_each, and deployments instantiate the entire Stack with specific input values.

Can Terraform Stacks use modules from private registries?

Yes, components support private registry sources using the format app.terraform.io/<org>/<module>/<provider> with version constraints. HCP Terraform workspaces authenticate to private registries automatically; CLI users need configured credentials.

How do I authenticate Terraform Stacks to AWS without static credentials?

Use workload identity with an identity_token block specifying the AWS audience, then configure the provider with assume_role_with_web_identity using the token JWT. This provides temporary scoped credentials per deployment run without long-lived secrets.

Why does the Terraform Stacks diagnostics API return empty results?

The stack-diagnostics endpoint requires the stack_deployment_step_id query parameter; without it the API returns empty results. Include the failed step ID from the deployment steps endpoint to retrieve error details with file locations and code snippets.

How do I destroy a Terraform Stack deployment?

Set destroy = true in the deployment block, upload the configuration, and approve the destroy run in HCP Terraform. After destruction completes, remove the deployment block from your configuration; deployments cannot be destroyed from the UI directly.