How to scaffold a production-grade AWS VPC module
Quand l'utiliser : Day one of a new AWS account; you want a VPC module that won't embarrass you in 6 months.
Prérequis
- Skill installed — git clone https://github.com/LukasNiessen/terrashark ~/.claude/skills/terrashark
- terraform CLI 1.6+ — brew install terraform
Déroulement
-
Generate moduleUse terrashark. AWS VPC module, 3 AZs, public + private + db subnets, NAT gateways per AZ, flow logs on.✓ Copié→ 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.✓ Copié→ Security group + logging + KMS wired
-
ValidateRun terraform init + validate + plan with example tfvars.✓ Copié→ Clean plan output, no errors
Résultat : A VPC module that terraform validates clean and follows AWS best practices.
Pièges
- 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