by hericium · 4y ago · 0 comments
Those "let's just use silly count or for_each to enable/disable the block" suddenly not always worked for randomish weird reasons requiring digging into TF_LOG=trace logs. Other simple things that you are used to with AWS were not so simple anymore.
DRY writing wasn't an issue with AWS provider but I find it to be an issue with Terraform itself when provider module isn't covering for tf's shortcomings.
It baffles me that there's still no way of just disabling a block without having to introduce a count parameter, that should have been fixed ages ago.
for_each is (weird and unpleasant but) an option, too.
for_each = var.enabled ? ["thing"] : []