aws_s3_access_points resource
Use the aws_s3_access_points InSpec audit resource to test properties of a Multiple specific S3 bucket points resource.
For additional information, including details on parameters and properties, see the AWS documentation on AWS S3 Access Points..
Syntax
Ensure that the base path mapping exists.
describe aws_s3_access_points(bucket_name: 'BUCKET_NAME') do
it { should exist }
end
Parameters
bucket_name(required)The name of the bucket containing the metrics configuration to retrieve.
Properties
ids- The ID used to identify the metrics configuration.
Field:
idfilter_access_point_arns- The access point ARN used when evaluating a metrics filter.
Field:
filter.access_point_arnfilter_and_access_point_arns- The access point ARN used when evaluating an AND predicate.
Field:
filter.and.access_point_arn
Examples
Ensure that an ID is available:
describe aws_s3_access_points(bucket_name: 'BUCKET_NAME') do
its('ids') { should include 'AccessPointArn' }
end
Ensure that stage name is available:
describe aws_s3_access_points(bucket_name: 'BUCKET_NAME') do
its('filter_access_point_arns') { should include 'AccessPointArn' }
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_s3_access_points(bucket_name: 'BUCKET_NAME') do
it { should exist }
end
Use should_not to test the entity does not exist.
describe aws_s3_access_points(bucket_name: 'BUCKET_NAME') do
it { should_not exist }
end
be_available
Use should to check if the entity is available.
describe aws_s3_access_points(bucket_name: 'BUCKET_NAME') do
it { should be_available }
end
AWS Permissions
Your AWS principal will need the S3:Client:listBucketMetricsConfigurationOutput action with Effect set to Allow.