How to scaffold a production-grade AWS VPC module
언제 쓸까: Day one of a new AWS account; you want a VPC module that won't embarrass you in 6 months.
사전 조건
- Skill installed — git clone https://github.com/LukasNiessen/terrashark ~/.claude/skills/terrashark
- terraform CLI 1.6+ — brew install terraform
흐름
-
Generate moduleUse terrashark. AWS VPC module, 3 AZs, public + private + db subnets, NAT gateways per AZ, flow logs on.✓ 복사됨→ 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.✓ 복사됨→ Security group + logging + KMS wired
-
ValidateRun terraform init + validate + plan with example tfvars.✓ 복사됨→ Clean plan output, no errors
결과: A VPC module that terraform validates clean and follows AWS best practices.
함정
- 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