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 when creating S3 backend in mx-central-1 region #36624

Closed
sebastianmarines opened this issue Mar 4, 2025 · 2 comments · Fixed by #36625
Closed

Invalid AWS Region when creating S3 backend in mx-central-1 region #36624

sebastianmarines opened this issue Mar 4, 2025 · 2 comments · Fixed by #36625
Labels
backend/s3 bug new new issue not yet triaged upstream

Comments

@sebastianmarines
Copy link
Contributor

Terraform Version

Terraform v1.11.0
on darwin_arm64

Terraform Configuration Files

terraform {
  backend "s3" {
    bucket = "samplebucket"
    key    = "terraform-state"
    region = "mx-central-1"
  }
}

Debug Output

TF_LOG=trace terraform init
2025-03-04T00:14:19.280-0600 [INFO]  Terraform version: 1.11.0
2025-03-04T00:14:19.281-0600 [DEBUG] using github.com/hashicorp/go-tfe v1.70.0
2025-03-04T00:14:19.281-0600 [DEBUG] using github.com/hashicorp/hcl/v2 v2.23.0
2025-03-04T00:14:19.281-0600 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2025-03-04T00:14:19.281-0600 [DEBUG] using github.com/zclconf/go-cty v1.16.0
2025-03-04T00:14:19.281-0600 [INFO]  Go runtime version: go1.23.3
2025-03-04T00:14:19.281-0600 [INFO]  CLI args: []string{"terraform", "init"}
2025-03-04T00:14:19.281-0600 [TRACE] Stdout is a terminal of width 93
2025-03-04T00:14:19.281-0600 [TRACE] Stderr is a terminal of width 93
2025-03-04T00:14:19.281-0600 [TRACE] Stdin is a terminal
2025-03-04T00:14:19.281-0600 [DEBUG] Attempting to open CLI config file: /Users/sebastian/.terraformrc
2025-03-04T00:14:19.281-0600 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2025-03-04T00:14:19.282-0600 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2025-03-04T00:14:19.282-0600 [DEBUG] ignoring non-existing provider search directory /Users/sebastian/.terraform.d/plugins
2025-03-04T00:14:19.282-0600 [DEBUG] ignoring non-existing provider search directory /Users/sebastian/Library/Application Support/io.terraform/plugins
2025-03-04T00:14:19.282-0600 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2025-03-04T00:14:19.285-0600 [INFO]  CLI command args: []string{"init"}
Initializing the backend...
2025-03-04T00:14:19.288-0600 [TRACE] Meta.Backend: built configuration for "s3" backend with hash value 1519931300
2025-03-04T00:14:19.288-0600 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2025-03-04T00:14:19.288-0600 [TRACE] Meta.Backend: moving from default local state only to "s3" backend
2025-03-04T00:14:19.289-0600 [DEBUG] checking for provisioner in "."
2025-03-04T00:14:19.292-0600 [DEBUG] checking for provisioner in "/opt/homebrew/bin"
2025-03-04T00:14:19.292-0600 [TRACE] backend/local: state manager for workspace "default" will:
 - read initial snapshot from terraform.tfstate
 - write new snapshots to terraform.tfstate
 - create any backup at terraform.tfstate.backup
2025-03-04T00:14:19.292-0600 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate
2025-03-04T00:14:19.293-0600 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay
2025-03-04T00:14:19.293-0600 [TRACE] statemgr.Filesystem: read nil snapshot
2025-03-04T00:14:19.293-0600 [TRACE] Meta.Backend: ignoring local "default" workspace because its state is empty
╷
│ Error: Invalid region value
│
│   on main.tf line 5, in terraform:
│    5:     region = "mx-central-1"
│
│ Invalid AWS Region: mx-central-1

Expected Behavior

The backend should be configured to use the specified S3 bucket

Actual Behavior

╷
│ Error: Invalid region value
│
│   on main.tf line 5, in terraform:
│    5:     region = "mx-central-1"
│
│ Invalid AWS Region: mx-central-1

Steps to Reproduce

  1. terraform init

Additional Context

No response

References

No response

Generative AI / LLM assisted development?

No response

@bschaatsbergen
Copy link
Member

bschaatsbergen commented Mar 4, 2025

Hey @sebastianmarines,

Thank you for reporting this! The S3 backend is managed by the AWS Provider team at HashiCorp, and this issue has been added to their triage queue.

I’m tagging this with backend/s3 as it’s possible that the aws-sdk-go-base package we depend on lacks support for this region, since we implement a form of region validation in the S3 backend, using that package:

if err := validation.SupportedRegion(region); err != nil {

Thanks again!

@bschaatsbergen
Copy link
Member

bschaatsbergen commented Mar 4, 2025

For the record, it looks like hashicorp/aws-sdk-go-base#1248 added support for mx-central-1 which was released under v2.0.0-beta.61 (2025-01-15).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend/s3 bug new new issue not yet triaged upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants