How to scaffold a production-grade AWS VPC module
Quando usar: Day one of a new AWS account; you want a VPC module that won't embarrass you in 6 months.
Pré-requisitos
- Skill installed — git clone https://github.com/LukasNiessen/terrashark ~/.claude/skills/terrashark
- terraform CLI 1.6+ — brew install terraform
Fluxo
-
Generate moduleUse terrashark. AWS VPC module, 3 AZs, public + private + db subnets, NAT gateways per AZ, flow logs on.✓ Copiado→ Module with variables.tf, main.tf, outputs.tf — no hallucinated args
-
Add security defaultsEnsure default security group denies all, flow logs go to CloudWatch with KMS-CMK encryption.✓ Copiado→ Security group + logging + KMS wired
-
ValidateRun terraform init + validate + plan with example tfvars.✓ Copiado→ Clean plan output, no errors
Resultado: A VPC module that terraform validates clean and follows AWS best practices.
Armadilhas
- LLM suggests deprecated aws_vpc_endpoint arg — TerraShark grounds in current docs; if drift still happens, ask it to cite the HashiCorp page
- Module too monolithic — Ask for split: networking module vs. endpoints module separately