hashicorp avatar

Terraform Stacks

Comprehensive guide for authoring HashiCorp Terraform Stacks configuration files, components, and deployments.

CCM score
75 of 100
skills.sh installs
5.9K
GitHub stars
941
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers .tfcomponent.hcl and .tfdeploy.hcl syntax, file layout, and the Stack language rules that differ from regular Terraform HCL
  • Includes variable, provider, component, output, locals, and removed block patterns, plus identity token and deployment examples
  • Enforces workload identity (OIDC) over static credentials and marks tokens ephemeral so they stay out of state files
  • Designed for teams managing multi-region or multi-environment infrastructure that need component sources from local, registry, or Git modules

Install

$ npx -y skills add hashicorp/agent-skills --skill terraform-stacks -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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)

Details

Repository
github.com/hashicorp/agent-skills
Category
DevOps & Cloud

More from hashicorp/agent-skills

All 16

Similar to Terraform Stacks

More DevOps & Cloud