When a bucket has no initial contents, this resource fails with the error:
jq: error (at <stdin>:1): Cannot iterate over null (null)
This is because in this scenario, aws s3api list-objects --query 'Contents[].{LastModified: LastModified}' returns null, and max_by(.LastModified) is not a valid jq query.
Acceptance Criteria
[ ] The check for an empty bucket should return an empty list of versions, rather than returning an error.
When a bucket has no initial contents, this resource fails with the error:
This is because in this scenario,
aws s3api list-objects --query 'Contents[].{LastModified: LastModified}'
returnsnull
, andmax_by(.LastModified)
is not a valid jq query.Acceptance Criteria