thesoftwarehouse/copilot-collections/tsh-implementing-terraform-modules
Claude Code and agent skill by thesoftwarehouse/copilot-collections
- community
Checking that the SKILL.md file is still in the repository.
Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.
Install
npx vskill@latest install thesoftwarehouse/copilot-collections/tsh-implementing-terraform-modulesSKILL.md
Terraform Module Library
Production-ready Terraform module patterns for AWS, Azure, and GCP infrastructure.
Purpose
Create reusable, well-tested Terraform modules for common cloud infrastructure patterns across multiple cloud providers.
When to Use
- Build reusable infrastructure components
- Standardize cloud resource provisioning
- Implement infrastructure as code best practices
- Create multi-cloud compatible modules
- Establish organizational Terraform standards
Module Structure
Standard Module Pattern
AWS VPC Module Example
main.tf:
variables.tf:
outputs.tf:
Best Practices
- Use semantic versioning for modules
- Pin provider versions in versions.tf — use
aws ~> 6.0,azurerm ~> 4.0,google ~> 5.0 - Document all variables with descriptions
- Provide examples in examples/ directory
- Use validation blocks for input validation
- Output important attributes for module composition
- Use locals for computed values
- Implement conditional resources with count/for_each
- Test modules with Terratest
- Tag all resources consistently
Reference Files
references/aws-modules.md- AWS module patternsreferences/azure-modules.md- Azure module patternsreferences/gcp-modules.md- GCP module patterns
Testing
Use Terratest (Go) to test Terraform modules. Every module must include:
examples/complete/— a root module that calls the module under test with realistic values and re-exports its outputstests/module_test.go— Go test file that runsInitAndApply, reads outputs, asserts expected values, and always defersDestroy
Apply the following rules when writing tests:
- Always call
t.Parallel() - Always wrap options with
terraform.WithDefaultRetryableErrors - Always use
runtime.Caller(0)to resolveexamples/complete/path relative to the test file — never use hardcoded relative paths - Always use
single_nat_gateway = true(or equivalent cost-reducing flags) in test examples - Provide a plan-only variant of each test (using
InitAndPlanAndShowWithStruct) for fast PR validation that requires no AWS credentials - Use a dedicated AWS test account — never run against production
- Set
-timeout 30min CI to avoid hanging runs
Terraform vs Terragrunt Decision
Use plain Terraform when:
- Single environment, single region
- 2–3 environments in the same region (use workspaces or directory layout)
- Existing project without Terragrunt (don't migrate mid-project)
Use Terragrunt when:
- 4+ environments or multi-region deployments
- Monorepo with many independent stacks (need
run-all, dependency orchestration) - Team needs strict environment parity via inheritance
- Multi-account AWS (landing zone pattern)
- Greenfield with expected growth
Terragrunt Golden Path structure:
Related Skills
tsh-designing-multi-cloud-architecture- For architectural decisionstsh-optimizing-cloud-cost- For cost-effective designs
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/tsh-implementing-terraform-modules/SKILL.md
Popularity
- Repository stars
- 266
- Repository forks
- 18
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thesoftwarehouse/copilot-collections/tsh-implementing-terraform-modules)