At some point in time I felt that this is still too much code that also has some downsides under certain situations (an example is deepmerge and the "null value" problen that unsets nested default objects).
Object attribute defaults to the rescue!
A rather simple yet powerful way is to make use of optional attribute defaults (terraform 1.3+). An example for such a variable is shown here:
What is happening here?
For every object / value we declare the value as optional but still specify a fallback or default. This results in the behavior that terraform will set the default value for us if the attribute is not specified explicitly.
To apply nested defaults easily, we set the default of every nested object to be {} and terraform will kick in and apply the defaults of this object now in turn for us.
Isn't that somewhat awesome? Easy, well defined - stuff that everyone loves :-)