Deprecate "provider.region" in favor of "provider.defaultRegion"
See original GitHub issueUse case description
Many (and it was my case for long long time) assume that provider.region
property represents final region to be used in deployment. While in reality it’s the value of last resort, which is used if region
is not provided via other means (--region
CLI param).
Technically this property represents a default region fallback (if it’s not specified from command line)
To clarify this confusion. I propose to rename provider.region
to provider.defaultRegion
Proposed solution
- Internally replace reference of
service.provider.region
toservice.provider.defaultRegion
: - Preset
provider.defaultRegion
aside ofprovider.region
here: https://github.com/serverless/serverless/blob/ef530506d5044ab3312c829838bb29cfcd2c889f/lib/plugins/aws/provider.js#L231 - Recognize
service.provider.defaultRegion
(and favor overservice.provider.region
) in region resolution here: https://github.com/serverless/serverless/blob/ef530506d5044ab3312c829838bb29cfcd2c889f/lib/plugins/aws/provider.js#L1442 - Ensure schema for
provider.defaultRegion
: https://github.com/serverless/serverless/blob/ef530506d5044ab3312c829838bb29cfcd2c889f/lib/plugins/aws/provider.js#L804 - Deprecate
provider.region
setting in configuration. Probably best logic point for that is here: https://github.com/serverless/serverless/blob/ef530506d5044ab3312c829838bb29cfcd2c889f/lib/plugins/aws/provider.js#L230 - Update all documentation to use
defaultStage
instead ofstage
- Update all templates to use
defaultStage
instead ofstage
- Supplement no vars usage deprecation in
@serverless/enterprise-plugin
. So variables inprovider.defaultRegion
setting are also rejected: https://github.com/serverless/enterprise-plugin/pull/524
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
terraform tells me The argument "region" is required, but was ...
I'm running into the same issue whenever I execute terraform plan inside a new project. Terraform v0.12.12 + provider.aws v2.33.0.
Read more >Provider Configuration | Terraform - HashiCorp Developer
Some providers require you to configure them with endpoint URLs, cloud regions, or other settings before Terraform can use them. This page documents...
Read more >com.amazonaws.regions (AWS SDK for Java - 1.12.360)
Loads region information from the shared AWS config file. ... Default region provider chain used when no explicit region is supplied to a...
Read more >Google Provider Configuration Reference - Terraform Registry
If another project is specified on a resource, it will take precedence. region - (Optional) The default region to manage resources in. If...
Read more >Changing the default region or zone - Compute Engine
When you use the Google Cloud console to create regional or zonal resources like addresses and instances, Compute Engine sets the region and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @medikoo Thanks for checking. I did not start working on this. please let @WillHof take it, if possible #8684 as well. Sorry for the delay I was occupied with other priorities.
As this change will be breaking for many services, I’m downgrading it to needs feedback. It’s not in consideration at this point