terraform

Guides writing, reviewing, and validating Terraform HCL configurations and modules.

Updated May 22, 2026
One-click install
npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill terraform-viniciuscs84
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform
Source: https://github.com/viniciuscs84/sdd-toolkit/tree/main/skills/terraform
Command: npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill terraform-viniciuscs84

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Terraform without consistent conventions leads to unpinned providers, unstable resource addressing, leaked secrets, and failed applies. This Skill provides a structured set of HCL authoring standards covering project layout, resource patterns, module design, and pre-commit validation. ## Core Features & Use Cases - Project Setup Standards: Defines file organization (terraform.tf, providers.tf, variables.tf, outputs.tf) and enforces version pinning for both the Terraform CLI and providers. - Resource Authoring Rules: Covers naming conventions, variable validation blocks, for_each over count for stable addressing, and security defaults like encryption at rest and sensitive outputs. - Module Development: Specifies standard module layout, input validation, output composition patterns, and a pre-commit checklist using terraform fmt, validate, tflint, and tfsec. - Use Case: When refactoring a VPC module, apply the composition pattern to consume outputs like vpc_id and private_subnet_ids from one module in another, then run the pre-commit checklist before pushing. ## Quick Start Use the terraform skill to review my main.tf and variables.tf for naming, validation, and security issues before I commit.

Frequently Asked Questions about terraform

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

FAQPage Schema
How do I structure a Terraform project with multiple files?

Split configuration by purpose: terraform.tf for version and provider constraints, providers.tf for provider configuration, main.tf for resources, variables.tf and outputs.tf for inputs and outputs in alphabetical order, and locals.tf for shared computed values.

Should I use count or for_each in Terraform resources?

Use for_each with a set or map for collections of resources, since keys remain stable when items are added or removed. Reserve count for conditional single-resource creation like count = var.enable_x ? 1 : 0, because indexed resources shift when middle items are removed.

How do I pin Terraform provider versions safely?

Pin both the CLI and providers in terraform.tf using required_version and required_providers with the pessimistic operator, for example version = "~> 5.0". This allows patch and minor updates while blocking breaking major version upgrades on terraform init.

How do I handle secrets and sensitive values in Terraform?

Never hardcode credentials in .tf files; pass them via environment variables, IAM roles, or CI secrets into variables. Mark secret variables and outputs with sensitive = true, and keep .tfstate and .terraform/ out of version control since state stores values in plaintext.

What checks should run before committing Terraform code?

Run terraform fmt -recursive, terraform validate, tflint for linting, and tfsec or checkov for security scanning. Also confirm all variables have type and description, outputs have descriptions, versions are pinned, and no credentials are hardcoded.