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

aws_s3_bucket region cannot be set #14430

Closed
relnetops opened this issue Jul 31, 2020 · 2 comments
Closed

aws_s3_bucket region cannot be set #14430

relnetops opened this issue Jul 31, 2020 · 2 comments
Labels
service/s3 Issues and PRs that pertain to the s3 service.

Comments

@relnetops
Copy link

relnetops commented Jul 31, 2020

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

GitLab Pipeline (image: hashicorp/terraform)

$ terraform init
 Initializing the backend...
 Successfully configured the backend "s3"! Terraform will automatically
 use this backend unless the backend configuration changes.
 Initializing provider plugins...
 - Checking for available provider plugins...
 - Downloading plugin for provider "aws" (hashicorp/aws) 3.0.0...

Local

% terraform -v  
Terraform v0.12.29
+ provider.aws v3.0.0

Affected Resource(s)

  • aws_s3_bucket

Terraform Configuration Files

resource "aws_s3_bucket" "https_bucket" {
  bucket = local.cloudfront_https_bucket_name
  acl    = var.acl
  region = var.aws_region

  versioning {
    enabled = var.versioning_enabled
  }

  server_side_encryption_configuration {
    rule {
      apply_server_side_encryption_by_default {
        sse_algorithm = "AES256"
      }
    }
  }

  tags = merge(local.tags, map("Name", local.cloudfront_https_bucket_name))
}

Debug Output

Panic Output

 $ terraform plan -out plan-$ENV.txt
 Error: "region": this field cannot be set
   on s3.tf line 36, in resource "aws_s3_bucket" "https_bucket":
   36: resource "aws_s3_bucket" "https_bucket" {

Expected Behavior

No changes. Infrastructure is up-to-date.

Actual Behavior

Error: "region": this field cannot be set

Steps to Reproduce

# update to latest terraform and aws provider:
terraform init

# run plan against unchanged config
terraform plan

Important Factoids

GitLab pipeline uses the latest hashicorp/terraform image:

.plan:
  stage: test
  image:
    name: hashicorp/terraform
    entrypoint: [""]
  script:
    - cd automation
    - terraform init
    - terraform workspace select $ENV
    - terraform plan -out plan-$ENV.tfplan

References

@ghost ghost added the service/s3 Issues and PRs that pertain to the s3 service. label Jul 31, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 31, 2020
@bflad
Copy link
Contributor

bflad commented Jul 31, 2020

Hi @relnetops 👋 Thank you for filing this. Please note this is expected behavior in version 3.0.0 and later of the Terraform AWS Provider. The region of the bucket is determined by the region of the provider, similar to all other resources. Please see the Version 3 Upgrade Guide for more information.

@bflad bflad closed this as completed Jul 31, 2020
@ghost
Copy link

ghost commented Aug 30, 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 Aug 30, 2020
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

No branches or pull requests

3 participants