skills.vishalvoidskills/vishalvoid
Technical & DevelopmentIntermediate

terraform-stacks

Manage infrastructure across multiple environments, regions, and cloud accounts

Developer Setup

Setup & Installation

bash
npx skills add https://github.com/hashicorp/agent-skills --skill terraform-stacks

Overview

What This Skill Does

Terraform Stacks adds a configuration layer above traditional Terraform modules for managing infrastructure across multiple environments, regions, and cloud accounts. It introduces two file types (.tfcomponent.hcl and .tfdeploy.hcl) that define reusable components and deployment instances separately. A single stack can drive dozens of deployments with isolated state per environment.

Application

When to use this Skill

Documentation

Show Skills.md file

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)

All configuration files must be at the root level of the Stack repository. HCP Terraform processes all files in dependency order.

Recommended File Organization

Lines 1 - 25 of 472

Recommendations

Explore other random skills

All skillsMy patterns