what
- This allows users to edit the backend config file once written and not have to worry about it being overwritten by the module due to changes.
why
- Any changes to the backend.tf file are overwritten on the next apply, which can be annoying if trying to specify additional
required_providers
,required_version
, or other terraform configuration block changes. This updates the template file block so that file is not overwritten if the backend.tf (or other terraform config file name) already exists.