Describe the Feature
Terraform S3 backend allows multiple state files to be stored in the same S3 bucket and with same DynamoDB table.
I would like to have a convenience feature provided by this module to generate multiple terraform backend config files at once with different values for different slices of the infrastructure.
Expected Behavior
Accept list of options for additional backend config files for which backend config files are render as output and/or local files.
Use Case
Hashicorp recommends splitting terraform config into separate root modules to manage logically grouped slices of infrastructure independently. Eg slice managing infrastructure wide concerns like networking, Vault and Consul clusters would be separate from infrastructure for one application which would also be separate from infrastructure for another application.
For such slices of the infrastructure it would be preferable to use same S3 bucket and lock table. I think it makes sense to manage backends for those slices within same module
Describe Ideal Solution
Additional input for the module that probably looks something like this:
Alternatives Considered
My own template file resource that duplicates behavior of "terraform_backend_config" in this module could do the same.
Probably, better approach to the one I suggested would be to extract backend config template into submodule of this module to allow independent backend file generation. This approach will take more effort but it would also be better from maintenance perspective, I think.
Additional Context
Sample HCL for how this feature could be used: