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

providers/aws: add aws_s3_bucket resource region argument #6051

Closed
u2mejc opened this issue Apr 6, 2016 · 8 comments · Fixed by #10482
Closed

providers/aws: add aws_s3_bucket resource region argument #6051

u2mejc opened this issue Apr 6, 2016 · 8 comments · Fixed by #10482

Comments

@u2mejc
Copy link
Contributor

u2mejc commented Apr 6, 2016

The current version of aws_s3_bucket doesn't support the region argument. It accepts input and will show it in planning / apply, but it doesn't apply it and throws no errors.

Having this as a feature would be useful for defining resources outside your default region (which is often us-east-1, due to some global resources not being available in every region).

Terraform v0.6.15-dev (aef5bcf98227b0ac964657a29ef2a1ebeed19a51)

@marcoamorales
Copy link

In v0.6.16 you can specify the region for an aws_s3_bucket, but it seems the attribute was left out from the documentation.

@u2mejc
Copy link
Contributor Author

u2mejc commented Jun 6, 2016

@marcoamorales It's looks visible in the code, but if you test it, you'll see it doesn't work:

resource "aws_s3_bucket" "b" {
    bucket = "terraform-test-delete-me"
    region = "us-west-2"
    tags {
        Name = "terraform-test-delete-me"
    }
}

The above says it applies successfully, but instead uses the global region used by terraform. (from ENV or the provider aws block.)

The reason is that Terraform uses helpers to initiate the golang SDK for every possible resource when it starts up, I wasn't able to think of a clean (non-hacky) way of re-initiating the helper each time a new S3 resource is requested.

Of note, I found that it's kind of mute since you can specify the region on a per module basis.

@iroller
Copy link
Contributor

iroller commented Aug 26, 2016

Also interested in region support for s3 buckets.

@lazycodeninja
Copy link

lazycodeninja commented Sep 28, 2016

We have a use case where a single module needs to create an S3 buckets in multiple regions. In fact, they're being created in the same aws_s3_bucket resource; driven by a map variable containing bucket names and their desired region (which does not work).

Between this issue and #3072 / #1819, there's no way to do this in a generic way driven by vars.

@phinze
Copy link
Contributor

phinze commented Nov 1, 2016

Yep looks like we read the region from the client, but don't fetch the value from the config to override it. Should be a pretty easy fix!

@Ninir
Copy link
Contributor

Ninir commented Dec 2, 2016

Hi guys,

Just worked on this in #10482 . Hope it will fit!

@josjaf
Copy link

josjaf commented Feb 18, 2020

I am still experiencing this error. I shouldn't have to define another provider to access another region. It's not respecting region flag inside the bucket.

@ghost
Copy link

ghost commented Feb 19, 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 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.

@ghost ghost locked and limited conversation to collaborators Feb 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants