finally: <https://opentofu.org/docs/language/meta-...
# random
s
finally: https://opentofu.org/docs/language/meta-arguments/enabled/ it took just 12 years to land that
👀 3
❤️ 1
j
lol using count is burned into my brain, gonna need to remember this exists
p
I think it's good and bad. The idea of an overall enable toggle works for simple, single-layer modules. This particular syntax is incompatible with Terraform, unless and until IBM/HashiCorp follows suit. Writers of open-source modules need compatibility. An overall enable flag in a multi-layered module tells me that module's authors haven't seen the infrastructure through its natural life in a large enterprise. An example is an RDS or Aurora database module that can optionally create CloudWatch log groups and turn on logging. Switch
create
,
enable
,
enabled
, etc. to
false
to retire the database and poof, the logs vanish, too! The organization's self-imposed security policy, its third-party compliance standards, and its customer contracts promise that logs are kept 3 years. Maybe someone thought to remove the log groups from the state file in time and they survive, orphaned in AWS and not tracked in Terraform (like the log groups that unwary users let Lambda create automatically). At best, someone gets stuck writing/generating one-off HCL and moving or re-importing. Dangling resource definitions live alongside new instances of the module.