Region-agnostic Providers for AWS and Google

Currently, the Google and AWS cloud providers require regions be set at provider initiation time, whereas Azure does not. This causes frustration because you cannot iterate over a list of providers when creating resources, so you cannot dynamically handle creating resources in multiple regions without resorting to third-party templating.

While perusing the AWS code, and being familiar with boto3 and somewhat familiar with aws-sdk-go, it seems like it should be possible to pass an AWS Session object from the provider configuration, and instantiate it as a region-locked client inside of each Resource.

I’d imagine the semantics being a region still specified in a provider block, and each resource using that region by default, but if a region was specified in the resource then creating a new client(s) with that region set.

The reason for this post is: has this approach been considered? Has it been discarded previously for reasons? It’s something I care enough about to possibly code a demo PR for a resource or two in the AWS provider, but I’d hate to do so if it’s been shot down already.

Did you end up attempting the project? Would be very curious, thanks!

Nope, the lack of feedback from Hashicorp along with changing to a position where I no longer use Terraform meant I never did this.

For certain users (many region SaaS companies using a lot of dynamic Terraform) this is a killer need, but I’ve never heard Hashicorp even acknowledge it as desirable.