Terraform

Which module anti-patterns should you avoid?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

  • Embedding provider blocks inside the module which makes reuse across accounts harder.

  • Accepting overly generic map(any) inputs that hide required structure instead of typed objects.

  • Outputting secrets or credentials without sensitive = true or secret stores.

  • Creating "god" root modules that mix networking, compute, and application concerns instead of composing smaller modules.

  • Copying and pasting modules without versioning, documentation, or automated tests.