How do I deploy the same module in multiple regions?
I'm looking to deploy the same module in every region (or at least a lot of them). Is there some example of this somewhere or a recommend approach? I've searched both the internet and these forums, sorry if I missed it. I'd really prefer to avoid something like https://github.com/gruntwork-io/terraform-aws-security/blob/master/modules/aws-config-multi-region/main.tf if there is a better way. I see https://github.com/gruntwork-io/terraform-aws-security/blob/master/modules/aws-config-multi-region/variables.autogen.tf, is this just scripted somewhere else and is it something we can use?
Fair point! One way you could do this is how we do it in `terraform-aws-security`. You found that autogen file, but it's created by a code generator in the [`codegen` directory](https://github.com/gruntwork-io/terraform-aws-security/tree/15239f3dd0225925e5ae482068b10f289a42ca3b/codegen). These contain code to automate the multi-region configuration. I think there's a fairly thorough explanation describing how you'd go about [adding a new module](https://github.com/gruntwork-io/terraform-aws-security/blob/15239f3dd0225925e5ae482068b10f289a42ca3b/codegen/core-concepts.md#adding-a-new-module), but from that info you could extrapolate how you'd write your own multi-region module generator. Check these out: * [Codegen Core Concepts](https://github.com/gruntwork-io/terraform-aws-security/blob/15239f3dd0225925e5ae482068b10f289a42ca3b/codegen/core-concepts.md) * [Root Codegen README](https://github.com/gruntwork-io/terraform-aws-security/tree/15239f3dd0225925e5ae482068b10f289a42ca3b/codegen)