steampipe-plugin-aws
steampipe-plugin-aws copied to clipboard
Use HeadObject to retrieve object metadata
This PR addresses #2311 by using HeadObject instead of GetObject to retrieve object metadata such as sse_kms_key_id. This severely speeds up queries requiring object metadata but not object contents.
Notes:
- Although the AWS documentation of GetObjectAttributes mentions it combining the functionality of HeadObject and ListParts, many metadata (Expires, ServerSideEncryption, ...) seem to appear only in the results of HeadObject. I did not manage to retrieve them as an object attribute.
- Calls to
GetObjectAttributespossibly could be replaced by calls toListParts. - If
GetObjectneeds to be called, there is never a need also to callHeadObject; I do not know if this is easily expressible in the Steampipe framework. - I don't know how I should run the tests, and there appear to be no tests yet for aws_s3_object, but I would be happy to look into this if someone can point me in the right direction.