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

data.terraform_remote_state: error initializing backend: Not a valid region: eu-west-3 #3129

Closed
ebarault opened this issue Jan 25, 2018 · 5 comments · Fixed by hashicorp/terraform#17193
Labels
bug Addresses a defect in current functionality. dependencies Used to indicate dependency changes.

Comments

@ebarault
Copy link

Hi,

I have an issue linked to eu-west-3 region support with terraform_remote_state.
This is linked to #2745, but might not be covered yet, since I follow the workarounds provided there (skip_region_validation) and this still does not work.

I could not find where the source code of terraform_remote_state is located to investigate myself.

Terraform Version

Terraform v0.11.2
AWS Provider 1.7.1

Affected Resource(s)

Please list the resources as a list, for example:

  • terraform_remote_state

Terraform Configuration Files

provider "aws" {
  version = "~> 1.7.0"
  allowed_account_ids = ["${var.allowed_account_id}"]
  region =  "eu-west-3"
  skip_region_validation = "true"
}

terraform {
  backend "s3" {
    bucket = "mybucket"
    key    = "path/to/my/key"
    region = "eu-west-3"
    skip_region_validation = "true"
  }
}


data "terraform_remote_state" "this" {
  backend = "s3"

  config {
    region = "eu-west-3"
    bucket = "path/to/this/key"
    key    = "terraform.tfstate"
  }
}
data.terraform_remote_state.vpc: Refreshing state...
Error: Error refreshing state: 1 error(s) occurred:
* data.terraform_remote_state.this: 1 error(s) occurred:
* data.terraform_remote_state.this: data.terraform_remote_state.this: error initializing backend: Not a valid region: eu-west-3

RELATED PR

#2745

@jen20
Copy link
Contributor

jen20 commented Jan 25, 2018

Hi @ebarault! Thanks for opening an issue. This likely requires the vendored version of the AWS plugin to be in updated in Terraform core - the provider knows about eu-west-3 but not the back end code (this is a client-side validation). I'll update the dependency in the main repository and open a pull request on it.

@ebarault
Copy link
Author

replying to myself:
it happens that we can also set the skip_region_validation = true option in each terraform_remote_state block like this:

data "terraform_remote_state" "this" {
  backend = "s3"

  config {
    region = "eu-west-3"
    bucket = "path/to/this/key"
    skip_region_validation = true
    key    = "terraform.tfstate"
  }
}

a bit annoying when requiring lots of terraform_remote_state, but works.

@jen20 jen20 added bug Addresses a defect in current functionality. dependencies Used to indicate dependency changes. labels Jan 25, 2018
@jen20
Copy link
Contributor

jen20 commented Jan 25, 2018

@ebarault The referenced pull request should do the trick - in the meantime your workaround is valid, if a little ugly!

@ebarault
Copy link
Author

@jen20 : thks, i'll follow the landing of this PR and update with my test results

jen20 added a commit to jen20/terraform that referenced this issue Jan 25, 2018
Also updates github.com/aws/aws-sdk-go and adds github.com/beevik/etree.

Fixes hashicorp/terraform-provider-aws#3129.
@ghost
Copy link

ghost commented Apr 8, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. dependencies Used to indicate dependency changes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants