-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Cannot pull modules from S3 buckets in AWS China regions #29418
Comments
@julian7 It looks like there is a problem with your module's |
@ewbankkit I couldn't see the I've tested both of your suggestions on AWS-CN in cn-northwest-1 region:
While, if I use the original test with my patched version, I'm getting the following error:
This latter has merit, or at least nobody has ever created example-bucket in cn-north-1 yet. |
It does seem reasonable that A logistical problem here is that go-getter doesn't have any dedicated maintainers, and yet go-getter is a shared dependency across many HashiCorp products and so we'll need to be careful about merging a change to it. Something like what's proposed in hashicorp/go-getter#335 does seem plausible to me, though I wonder if someone with more knowledge about the alternative AWS partitions can comment on whether there's a more generalized way to do this that would also work for GovCloud, or perhaps correct me that GovCloud already works due to it having a similar enough URL scheme to the primary partition. (Ideally I'd prefer a solution that won't need ongoing additions as AWS introduces new partitions or URL schemes, but I don't know if that's actually a feasible requirement to meet.) 🤔 |
@apparentlymart for the record, here are the S3 endpoint URLs: https://docs.aws.amazon.com/general/latest/gr/s3.html#s3_region |
Also, I was able to use the following source setting (which I don't know whether it's mentioned anywhere) with vanilla terraform v1.0.5 CLI:
|
Thanks for sharing the docs and that other example, @julian7! I'm honestly a bit baffled as to how that last example is working, because I'd expect it to be asking the S3 getter to fetch Go-getter is generally far too clever for its own good, but I'm glad you found something that works, at least. There isn't any test case shaped like that in go-getter so I have to assume this is by accident rather than by design, but since it's covered by our compatibility promises we can't change it now and ought to go add some additional test coverage to go-getter for it. |
(Incidentally, the forthcoming Terraform v1.1 includes an improvement to make |
@apparentlymart you're right, it makes no sense. However, I think at this stage the best what we can do is to use whatever is working, it's very hard to add more features to an already convoluted system. Especially, when there is a solid workaround. I'd say the workaround should be documented instead of any code changes at the moment. |
also facing the same issue while pulling terraform modules from s3 bucket in china. Method 1
Error : Method 2
Error : Method 3 also tried what @julian7 suggested
Error: |
Terraform Version
Terraform Configuration Files
Debug Output
(sry, considered making a gist, but for ten lines?)
Crash Output
N/A
Expected Behavior
I expected the example to fail because of invalid S3 bucket or nonexisting file. I expect terraform to download modules correctly when correct source is present.
Actual Behavior
terraform init
returns the following error:The host name
s3.amazonaws.amazonaws.com
is totally not what the original URL was.Steps to Reproduce
terraform init
Additional Context
I've updated go-getter at my end to honor amazonaws.com.cn S3 URLs (see references), and it works for me.
References
The text was updated successfully, but these errors were encountered: