Additional properties as documented in aws_s3_bucket_object Resource do not appear to be available, and I am curious if there is some setup I need to do. When I run the following, I get the following error:
describe aws_s3_bucket_object(bucket_name: "x", key: "x/x/x.zip") do
it { should exist }
its('content_type') { should eq "image/jpeg" }
its('object_acl.count') { should eq 1 }
end
[FAIL] content_type undefined method `content_type' for s3://inseq-lab-cgsweb/Binaries/ServerBuilds/WebgateInstall.zip:#Class:0x00000279f5859bb8
I am also hoping to be able to get the SHA256 checksum for bucket objects but that property is also unavailable.
I reviewed the source code for the inspec aws inspec controls and it appears that although the documentation states you can retrieve other properties to test, you cannot in fact do it.
There may be permissions issues? I have seen where permissions can allow you to view an object in the console but not allow you to access or manipulate via CLI or code.
Not saying this is the issue, but maybe worth looking into it can only cost you a little time to be sure.
As you can see, content_type is one of the returned keys, so it should, in theory, be an accessible property. OTOH, the SHA256 checksum is not a documented option and is not one of the returned keys either.