hashicorp avatar

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-code

Installs 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
1jeffallan avatarterraform-engineerjeffallan/claude-skillsUse when implementing infrastructure as code with Terraform across AWS, Azure, or GCP. Invoke for module development (create reusable modules, manage module ver5.7Kskills.sh installs
2affaan-m avatarcost-aware-llm-pipelineaffaan-m/eccCost optimization patterns for LLM API usage — model routing by task complexity, budget tracking, retry logic, and prompt caching.5.6Kskills.sh installs
3affaan-m avataropensource-pipelineaffaan-m/eccOpen-source pipeline: fork, sanitize, and package private projects for safe public release. Chains 3 agents (forker, sanitizer, packager). Triggers: '/opensourc5.4Kskills.sh installs
4affaan-m avatarcost-aware-llm-pipelineaffaan-m/everything-claude-codecost aware llm pipeline5.4Kskills.sh installs
5affaan-m avatarralphinho-rfc-pipelineaffaan-m/eccRFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.5.4Kskills.sh installs
6affaan-m avatarrecsys-pipeline-architectaffaan-m/eccDesign composable recommendation, ranking, and feed pipelines using the six-stage Source→Hydrator→Filter→Scorer→Selector→SideEffect framework popularized by xAI5.4Kskills.sh installs