
Terraform Stacks
If you're managing infrastructure across multiple environments or regions with Terraform, this skill covers the Stacks abstraction layer that sits above traditional modules. It explains the component and deployment model, walks through the `.tfcomponent.hcl` and `.tfdeploy.hcl` file structure, and details how provider configurations work differently in Stacks (they support for_each and use config blocks). The workload identity guidance is solid, showing OIDC setup instead of static credentials. Most useful when you're orchestrating multiple related modules together and need to understand how component references, outputs, and cross-component dependencies actually work in the Stacks HCL dialect.
- skills.sh installs
- 5.8K
- GitHub stars
- 924
- last updated
- Aug 21, 2026
Install
$ npx -y skills add hashicorp/agent-skills --skill terraform-stacks --agent claude-codeInstalls into .claude/skills of the current project.
Files
Terraform Stacks
Terraform Stacks simplify infrastructure provisioning and management at scale by providing a configuration layer above traditional Terraform modules. Stacks enable declarative orchestration of multiple components across environments, regions, and cloud accounts.
Core Concepts
Stack: A complete unit of infrastructure composed of components and deployments that can be managed together.
Component: An abstraction around a Terraform module that defines infrastructure pieces. Each component specifies a source module, inputs, and providers.
Deployment: An instance of all components in a stack with specific input values. Use deployments for different environments (dev/staging/prod), regions, or cloud accounts.
Stack Language: A separate HCL-based language (not regular Terraform HCL) with distinct blocks and file extensions.
File Structure
Terraform Stacks use specific file extensions:
- Component configuration:
.tfcomponent.hcl - Deployment configuration:
.tfdeploy.hcl - Provider lock file:
.terraform.lock.hcl(generated by CLI)
Sponsors
Details
- Repository
- github.com/hashicorp/agent-skills
- Categories
- DevOps & CI/CD, Documentation, AI & Agent Building, Debugging, Cloud & Infrastructure
More from hashicorp/agent-skills
All 16- Terraform Search Import5.1K
- Provider Resources4.2K
- New Terraform Provider4K
- Provider Actions4K
- Run Acceptance Tests3.8K
- Azure Verified Modules3.4K
- Provider Test Patterns3.4K
- Provider Docs3.3K
- Aws Ami Builder3.3K
- Push To Registry3.1K
- Azure Image Builder2.8K
- Windows Builder2.8K
- Terraform Style Guide13.2K
- Terraform Test9.2K
- Refactor Module6.6K