terraform-stacks

Automate orchestration and validation of HashiCorp Terraform Stacks across environments.

Updated Jul 30, 2024
One-click install
npx skills add https://github.com/twidxuga/dotfiles --skill terraform-stacks-twidxuga
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-stacks
Source: https://github.com/twidxuga/dotfiles/tree/main/opencode/dot-config/opencode/skills/terraform-stacks
Command: npx skills add https://github.com/twidxuga/dotfiles --skill terraform-stacks-twidxuga

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Terraform Stacks provide a declarative configuration layer to orchestrate and validate infrastructure provisioning across multiple Terraform modules and environments, reducing drift and manual effort.

Core Features & Use Cases

  • Stack: a complete unit of infrastructure that groups components and deployments for consistent lifecycle management.
  • Component: an abstraction around a Terraform module with a defined source, inputs, and providers.
  • Deployment: an instance of all components in a stack across environments (dev/staging/prod) and regions.
  • File Structure: guidance on using .tfcomponent.hcl and .tfdeploy.hcl files, local modules, and module registries to compose infrastructure.
  • Multi-Region & Deployment: supports deploying the same stack across multiple regions/environments with shared configurations.

Quick Start

Initialize the Stack by running terraform stacks init in the Stack root after placing your .terraform-version and at least one .tfcomponent.hcl.

Frequently Asked Questions about terraform-stacks

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

FAQPage Schema
How do I orchestrate Terraform modules across multiple environments?

Orchestrate Terraform modules across environments by grouping them into a Stack using .tfcomponent.hcl files to define sources, inputs, and providers for consistent lifecycle management. This reduces manual effort and drift across dev, staging, and prod.

What is a Terraform Stack and when do I need it for infrastructure deployment?

A Terraform Stack is a declarative configuration layer that groups components and deployments for consistent lifecycle management. You need it to validate and orchestrate infrastructure provisioning across multiple Terraform modules and environments, reducing drift.

How do I initialize a Terraform Stack for multi-region deployment?

Initialize a Terraform Stack by placing a .terraform-version file and at least one .tfcomponent.hcl file in the Stack root, then run terraform stacks init. This prepares the stack for deploying across multiple regions and environments with shared configurations.

Can I use local Terraform modules within a Stack deployment?

Yes, you can use local modules within a Stack deployment by defining them in your .tfcomponent.hcl files. The stack configuration also supports module registries to compose infrastructure across environments and regions.

How do I troubleshoot Terraform Stack syntax errors during deployment?

Troubleshoot Terraform Stack syntax errors by validating your .tfcomponent.hcl and .tfdeploy.hcl file structures. The orchestration layer automates validation to ensure correct configuration across components and deployments before applying changes.

What is the difference between a component and a deployment in Terraform Stacks?

A component is an abstraction around a Terraform module with defined sources and inputs, while a deployment is an instance of all components in a stack across specific environments and regions, managing the complete infrastructure lifecycle.