|
|
|
|
|
by tn890
1428 days ago
|
|
I used to be obsessed with DRY. After having written tens of thousands of terraform lines in the last few years across a multitude of platforms and use cases, I say everything in moderation. Going DRY is a decision you pay for in complexity, it's the typical programming problem of genericity. Sometimes it absolutely makes sense and you're a mad man if you skip it, but in isolated cases making things DRY just for the sake of it is just as nuts as not doing it when required. It's a fine line to walk and it requires hands-on experience to know when to employ DRY and when to repeat yourself. |
|
If I change the common code, do I want all users of it to realize those changes implicitly?
Terraform provides good enough tools to allow for deviations (even significant ones) between dev, staging, and prod.
IMO one of the most valuable things Terraform can do for you is stand up _the exact same stuff_ in multiple environments. If you're applying different code, your confidence in that shrinks significantly.