Skip to content
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

Invalid AWS Region: eu-central-2 coming from Terraform CLI #33575

Closed
dosilyoun opened this issue Jul 25, 2023 · 7 comments
Closed

Invalid AWS Region: eu-central-2 coming from Terraform CLI #33575

dosilyoun opened this issue Jul 25, 2023 · 7 comments

Comments

@dosilyoun
Copy link

Terraform Version

Terraform v1.4.6

Terraform Configuration Files

backend "s3" {
# Replace this with your bucket name!
bucket = "example"
key = "example/tfstate"
region = "eu-central-2"

# Replace this with your DynamoDB table name!
dynamodb_table = "example"
encrypt        = true

}

Debug Output

Upgrading modules...

  • ec2-ami in modules/ec2-ami
  • s3 in modules/s3
  • vpc in modules/vpc

Initializing the backend...
region
AWS region of the S3 Bucket and DynamoDB Table (if used).

Enter a value: eu-central-2


│ Error: Invalid AWS Region: eu-central-2


Expected Behavior

no error message without region_skip_validation

Actual Behavior

Error: Invalid AWS Region: eu-central-2

Steps to Reproduce

terraform init

Additional Context

No response

References

No response

@dosilyoun dosilyoun added bug new new issue not yet triaged labels Jul 25, 2023
@kmoe kmoe added backend/s3 and removed new new issue not yet triaged labels Jul 25, 2023
@apparentlymart
Copy link
Contributor

Hi @dosilyoun,

The set of valid regions is encoded in the AWS SDK that Terraform uses to interact with S3, and so this region might be available in a newer version of the SDK.

Have you tried with the latest version of Terraform to see if the SDK is updated to know about this region? At the time I'm writing this comment the latest release is v1.5.3.

If even the latest version does not support this region then we may need to upgrade to a newer version of the AWS SDK to get support for it, and then make a new Terraform release with the updated SDK.

In the meantime you can configure the backend to assume all regions are valid using the option you already found.

Thanks!

@crw
Copy link
Contributor

crw commented Jul 25, 2023

Per #33469 (comment), there is a project to upgrade the aws sdk version underway. Just FYI.

@sahilsk
Copy link

sahilsk commented Aug 3, 2023

@apparentlymart for your responses and thank you @crw for sharing the update on upgrade progress.

For extra clarity let me add more details here:

Problem is not with with the providers. (It could be with providers if your root module is using those regions, but that's the concern of aws team to resolve).

As far as terraform is concerned issue is with backend backed by s3.

During the terraform init stage it initialize aws s3 backed using aws-sdk-go and there the support of zurich and other regions was found missing across all terraform releases including 1.6.x at the time of writing this comment.

Support for zuich was added in aws-sdk-go@v1.44.35 and for Melbourne in aws-sdk-go@v1.44.85.
I custom compiled the terraform binary with these updated sdk to confirm and it does work

One thing i would like to advise aws folks is to be more verbose about such major release. Nowhere in the changelog it's mentioned that zurich support is added: aws/aws-sdk-go#4619

@dosilyoun
Copy link
Author

Discussion is going on #33607

@crw
Copy link
Contributor

crw commented Aug 24, 2023

Problem is not with with the providers.

The provider teams maintain the backends in their respective domains. The AWS team maintains the S3 backend, Azure team maintains the Azure backend, etc. Just FYI.

@apparentlymart
Copy link
Contributor

In the meantime the s3 backend has switched to AWS SDK v2 and is using v1.25.3 in the main branch at the time I'm writing this comment.

I see references to eu-central-2 in the source code for that release, so it seems like this region should now be supported. Therefore I'm going to close this. The AWS SDK's treatment of regions is somewhat complicated, with some variation between services, so please let me know if I've missed something that means that we should leave this open!

Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants