aws_cloudfront_key_groups resource
Use the aws_cloudfront_key_groups InSpec audit resource to test properties of multiple AWS CloudFront key groups.
For additional information, including details on parameters and properties, see the AWS documentation on AWS CloudFront key group..
Syntax
Ensure that the key group exists.
describe aws_cloudfront_key_groups do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
ids- The identifier for the key group.
Field:
idlast_modified_times- The date and time when the key group was last modified.
Field:
last_modified_timenames- A name to identify the key group.
Field:
nameitems- A list of the identifiers of the public keys in the key group.
Field:
itemscomments- A comment to describe the key group. The comment cannot be longer than 128 characters.
Field:
comment
Examples
Ensure an ID is available:
describe aws_cloudfront_key_groups do
its('ids') { should include 'ID' }
end
Ensure that the key group name is available:
describe aws_cloudfront_key_groups do
its('names') { should include 'KEY_GROUP_NAME' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.The controls will pass if the list method returns at least one result.
exist
Use should to test that the entity exists.
describe aws_cloudfront_key_groups do
it { should exist }
end
Use should_not to test that an entity does not exist.
describe aws_cloudfront_key_groups do
it { should_not exist }
end
AWS Permissions
Your AWS principal will need the CloudFront:Client:ListKeyGroupsResult action with Effect set to Allow.