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: ap-southeast-3 #22252

Closed
jbg opened this issue Dec 16, 2021 · 10 comments
Closed

Invalid AWS Region: ap-southeast-3 #22252

jbg opened this issue Dec 16, 2021 · 10 comments
Labels
provider Pertains to the provider itself, rather than any interaction with AWS.

Comments

@jbg
Copy link
Contributor

jbg commented Dec 16, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v1.1.0
on linux_arm64
provider registry.terraform.io/hashicorp/aws v3.69.0

Affected Resource(s)

aws_*

Terraform Configuration Files

provider "aws" {
  region = "ap-southeast-3"
}

Expected Behavior

The provider initialises correctly.

Actual Behavior

│ Error: Invalid AWS Region: ap-southeast-3
│   with provider["registry.terraform.io/hashicorp/aws"]

Steps to Reproduce

  1. terraform apply

References

https://aws.amazon.com/blogs/aws/now-open-aws-asia-pacific-jakarta-region/

@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 16, 2021
@ewbankkit ewbankkit added the provider Pertains to the provider itself, rather than any interaction with AWS. label Dec 16, 2021
@ewbankkit
Copy link
Contributor

@jbg Thanks for raising this issue.
Until support for the new ap-southeast-3 Region has been added to the provider you can use the skip_region_validation argument:

provider "aws" {
  region = "ap-southeast-3"

  skip_region_validation = true
}

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Dec 16, 2021
@jbg
Copy link
Contributor Author

jbg commented Dec 16, 2021

Thanks for the workaround. Unfortunately it doesn't work if the tf config includes any data.aws_region because the aws-sdk-go version used in the latest release of this provider doesn't know about ap-southeast-3.

@ewbankkit
Copy link
Contributor

ewbankkit commented Dec 16, 2021

The upcoming v3.70.0 Terraform AWS Provider release will use AWS SDK v1.42.23 (#22203) which adds ap-southeast-3 to the list of regions for the standard AWS partition. The aws_region data source will then support the new region.

@aashari
Copy link

aashari commented Dec 20, 2021

@ewbankkit I still can't use data "aws_region" "current" {}, it is shown this error

│ Error: error configuring Terraform AWS Provider: error validating provider credentials: error calling sts:GetCallerIdentity: InvalidClientTokenId: The security token included in the request is invalid
│       status code: 403, request id: d8b2cf3a-9f9f-4933-944b-1d5aa308575a
│
│   with provider["registry.terraform.io/hashicorp/aws"],
│   on backend.tf line 10, in provider "aws":
│   10: provider "aws" {
│

here is my code

terraform {
  required_providers {
    aws = {
      source = "hashicorp/aws"
      version = "3.70.0"
    }
  }
}

provider "aws" {
  region = "ap-southeast-3"
  skip_region_validation=true
}

data "aws_region" "current" {
}

output "region_name" {
  description = "The name of the selected region."
  value       = data.aws_region.current.id
}

I also have tried removing skip_region_validation=true attribute but still don't work, i'm using terraform 1.0.0, can you help elaborate?

It is works fine without any data "aws_*" block, but most terraform module in my building blocks are using data "aws_*" resources

@jbg
Copy link
Contributor Author

jbg commented Dec 20, 2021

You probably need to enable the region (as with all new AWS regions). Note that if you run Terraform in a separate AWS account from your resources, you need to enable the region in both accounts.

@aashari
Copy link

aashari commented Dec 20, 2021

You probably need to enable the region (as with all new AWS regions). Note that if you run Terraform in a separate AWS account from your resources, you need to enable the region in both accounts.

I have enabled the region in my account, all works fine without data "aws_*" block

@jbg
Copy link
Contributor Author

jbg commented Dec 20, 2021

We also use data "aws_region" and it's working fine in ap-southeast-3 here. Check that you enabled the STS token endpoint as well as the region.

@jbg
Copy link
Contributor Author

jbg commented Dec 20, 2021

Since 3.70.0 is out I think this can be closed.

@YiGene
Copy link

YiGene commented Jan 30, 2022

you may still get same error on terraform s3, add skip region check resolved this
terraform {
backend "s3" {
skip_region_validation = true
.....

}

Terraform v1.1.4

@github-actions
Copy link

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 May 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
provider Pertains to the provider itself, rather than any interaction with AWS.
Projects
None yet
Development

No branches or pull requests

4 participants