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

Open
dosilyoun opened this issue Jul 25, 2023 · 5 comments
Open

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

dosilyoun opened this issue Jul 25, 2023 · 5 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
Member

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
Collaborator

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
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants