Installs into .claude/skills of the current project.
Are you the author of Infra Kit.Domain.Iac?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/huyngopt1994-infra-kit-domain-iac)
---
name: infra-kit.domain.iac
description: Create, review, validate, refactor, or troubleshoot Infrastructure-as-Code using Terraform and/or Terragrunt (modules, stacks, layouts, remote state, dependency wiring).
---
# IaC (Terraform + Terragrunt)
Use this skill when the work item will be implemented in Terraform and/or orchestrated via Terragrunt.
This is the unified IaC entrypoint for Terraform and Terragrunt.
## Outcomes
- Scaffold or refactor readable, reusable Terraform modules and stacks
- Design or fix Terragrunt layouts, includes, dependencies, and remote state conventions
- Review IaC for correctness, destructive change risk, and security gaps
- Fix validation failures and broken wiring across environments
## Workflow
1. Inspect the repository layout before changing files.
2. Identify what is actually in use:
- Terraform-only
- Terragrunt orchestrating Terraform/OpenTofu modules
3. Establish constraints:
- cloud/provider(s)
- environment model (dev/stage/prod)
- backend/remote state strategy
- naming + tag/label contract
4. Implement with the smallest correct change.
5. Validate with the strongest deterministic checks available.
## Terraform Authoring Notes
- Prefer explicit `required_version` and `required_providers`.
- Keep modules reusable: typed variables, useful descriptions, stable outputs.
- Use `locals` for repeated naming/tagging.
- Default IAM to least privilege unless the user explicitly accepts broader rights.
- Avoid secrets in code or example tfvars.
## Terragrunt Authoring Notes
- Inspect `include`/`find_in_parent_folders`/`read_terragrunt_config` paths from the caller’s file.
- Keep shared config centralized (often `root.hcl`) and push env-specific values to env layers.
- Use `dependency` blocks for real data flow and ordering.
- Treat `run --all` blast radius as a first-class risk.
## Hallucination Guardrails
- Don’t guess provider args, module outputs, or Terragrunt paths. Inspect files and cite them.
- When provider/module docs are needed, look up the official documentation (and mention version).
- List every command you actually ran; if skipped, state the blocker.
## Validation Loop
Prefer repo tooling first. Otherwise use the strongest available subset:
```bash
terraform fmt -recursive
terraform init
terraform validate
terraform plan
terragrunt hcl fmt
terragrunt init
terragrunt validate
terragrunt plan
```
Bundled helpers:
```bash
bash scripts/validate_iac.sh <path>
```
## Delivery Standard
Always leave the user with:
- the files changed (or the recommended layout)
- key assumptions (backend/state, accounts/regions, env model)
- validation commands run
- unresolved risks (especially destructive changes and state interactions)
Files in this skill
SKILL.md2.7 KB
examples/terraform/minimal-module/main.tf160 B
examples/terraform/minimal-module/outputs.tf106 B
examples/terraform/minimal-module/terraform.tfvars.example78 B
examples/terraform/minimal-module/variables.tf456 B
examples/terraform/minimal-module/versions.tf55 B
examples/terragrunt/live-aws/dev/app/terragrunt.hcl727 B
examples/terragrunt/live-aws/dev/env.hcl125 B
examples/terragrunt/live-aws/dev/vpc/terragrunt.hcl332 B
examples/terragrunt/live-aws/prod/app/terragrunt.hcl727 B
examples/terragrunt/live-aws/prod/env.hcl126 B
examples/terragrunt/live-aws/prod/vpc/terragrunt.hcl332 B