-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement]: Add region argument/parameter where appropriate #27758
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
I am looking into Guardduty and need to generate 23 providers, one for each supported region to enable Guardduty, it would be much simpler to just have a There is also a problem with having the region on provider level, if you create resources in the wrong region and then change the region on the provider, Terraform only wants to create the resource in the new region, but doesn't want to destroy the resource in the wrong region. |
If I were to create pull requests to add support for this for at least some resources, would that be likely to be accepted? (contingent on it being high enough quality of course) |
Hi @tmccombs 👋 We have been chatting with @brittandeyoung about this (he has put a compelling PoC together in #31517) and we are all positive about the approach. There is some internal due diligence we need to get through in introducing what is a bit of a paradigm change in how the provider is used. We have that scheduled for next quarter after which we will update to community on how we propose to implement and introduce it to the provider, would love feedback at that point. Appreciate your patience and input! |
It's two quarters later, @breathingdust ; is there an update? I don't see one here or on #31517 . Thanks! |
Description
When working with multiple regions, currently in most cases you have to use a separate aws provider alias for each region. While this is workable in many cases, there are other cases where it is not very workable. In the best case it means you have to duplicate your provider configuration, varying only in the region. In other cases it can seriously constrain the design of the terraform code. If resources allowed you to specify the region to use for them, through an attribute that override the default region of the provider, than it would simplify working with multiple regions without having to wait for support for more dynamic provider configuration from the terraform engine.
Example Use Cases
Here are some specific use cases where being able to create resources in multiple regions with the same provider would be beneficial:
Affected Resource(s) and/or Data Source(s)
Many. Some of the most important ones are possibly:
Potential Terraform Configuration
The example from https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_replica_key
could be rewritten to something like:
Or if used in a module that accepts multiple regions something like:
References
Some more specific issues:
aws_cloudwatch_log_subscription_filter
resource #24194Would you like to implement a fix?
No response
The text was updated successfully, but these errors were encountered: