-
Notifications
You must be signed in to change notification settings - Fork 104
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 should use HeadBucket instead of GetBucketLocation #1586
Comments
'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.' |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Took a quick look at using
|
Can't you see what the Edit: too bad AWS do not return the standard |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Using HeadBucket instead makes sense, because There is no such region as "EU", so steampipe AWS plugin right now has this crutch: steampipe-plugin-aws/aws/table_aws_s3_bucket.go Lines 422 to 429 in b71914e
I'm not sure how correct this is. I couldn't find any docs that actually say that |
It sort of does EverythingMe/ncdu-s3#4 🙂 |
FYI - work done here may also help with #1713 |
Hi, FYI I'm currently working on implementing this, and investigating the best options.
Indeed, the 301 happens when invoking When using the
With the AWS SDK for Go v2, it is currently not possible to retry that call as the SDK does not expose the header in case of 301 HTTP responses. And adding that feature has been rejected by the development team. As we only want the region information, there's no need to retry that call, making simple unauthenticated requests is enough to get the desired header:
Even with path style usage:
See aws/aws-sdk-go#356 (comment) Right now, I believe the way to go is to perform such plain HTTP HEAD requests to get the header value. |
That is surprising... Also, I'm not sure how much quota AWS provides for the rate of unauthenticated requests. It's probably lower? And the question is wether the response still contains the bucket region header if a RateExceeded or Throttling error is returned |
There's caching in the steampipe query data connection manager to avoid requesting the region to often for a single bucket. I've not faced throttling on that HEAD method yet, will perform more load testing ASAP to see how it behaves. FWIW, I'm almost done before submitting my PR. |
Submitted #2082, PTAL 🙏 |
From https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html:
steampipe-plugin-aws/aws/table_aws_s3_bucket.go
Lines 338 to 342 in 6418b0b
The text was updated successfully, but these errors were encountered: