Terraform-provider-aws: Error: "region": this field cannot be set

Created on 31 Jul 2020  ·  3Comments  ·  Source: hashicorp/terraform-provider-aws

Our Terraform scripts has been working fine but we are encountering an error with the aws_s3_bucket resource since today:

Error: "region": this field cannot be set

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 v0.12.18

  • provider.aws v3.0.0

Affected Resource(s)

  • aws_s3_bucket

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
needs-triage servics3

Most helpful comment

Anyone else having this issue, this is due to region no longer being an argument of the s3 bucket resource.
https://github.com/terraform-providers/terraform-provider-aws/blob/master/CHANGELOG.md

All 3 comments

Anyone else having this issue, this is due to region no longer being an argument of the s3 bucket resource.
https://github.com/terraform-providers/terraform-provider-aws/blob/master/CHANGELOG.md

@Edwin-Pau - Yup, seems like the last it was allowed as an argument was in Terraform AWS provider version 2.70.0.

There are 2 ways to go about it:

  • Remove the _region_ argument from aws_s3_bucket terraform resource code. In which case, it will inherit the region specified in the provider's declaration. (Ideal)
    _OR_
  • Hardcode your aws provider declaration to version 2.70.0. (I wouldn't recommend this, as you may end up locking yourself to a particular version of aws provider).

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!

Was this page helpful?
0 / 5 - 0 ratings