Skip to main content

aws_s3_access_point Resource

Use the aws_s3_access_point InSpec audit resource to test properties of a single specific S3 bucket resource.

For additional information, including details on parameters and properties, see the AWS documentation on AWS API Metric..

Install

This resource is available in the Chef InSpec AWS resource pack.

For information on configuring your AWS environment for Chef InSpec and creating an InSpec profile that uses the InSpec AWS resource pack, see the Chef InSpec documentation on the AWS cloud platform.

Syntax

Ensure that the base path mapping exists.

describe aws_s3_access_point(bucket_name: 'BUCKET_NAME', metrics_id: 'METRICS_ID') do
  it { should exist }
end

Parameters

domain_name (required)

The name of the bucket containing the metrics configuration to retrieve.

metrics_id (required)

The ID used to identify the metrics configuration.

Properties

id
The ID used to identify the metrics configuration.

Field: id

filter.access_point_arn
The access point ARN used when evaluating a metrics filter.

Field: filter.access_point_arn

filter.and.access_point_arn
The access point ARN used when evaluating an AND predicate.

Field: filter.and.access_point_arn

Examples

Ensure that the id is available.

describe aws_s3_access_point(bucket_name:  'BUCKET_NAME', metrics_id: 'METRICS_ID') do
    its('id') { should eq 'METRICS_ID' }
end

Ensure that access point arn is available.

describe aws_s3_access_point(bucket_name:  'BUCKET_NAME', metrics_id: 'METRICS_ID') do
    its('filter.access_point_arn') { should eq 'AccessPointArn' }
end

Matchers

For a full list of available matchers, see our Universal Matchers page.

This resource has the following special matchers.

exist

Use should to test that the entity exists.

describe aws_s3_access_point(bucket_name:  'BUCKET_NAME', metrics_id: 'METRICS_ID') do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_s3_access_point(bucket_name: 'dummy', metrics_id: 'dummy') do
  it { should_not exist }
end

be_available

Use should to check if the entity is available.

describe aws_s3_access_point(bucket_name: 'BUCKET_NAME', metrics_id: 'METRICS_ID') do
  it { should be_available }
end

AWS Permissions

Your Principal will need the S3:Client:GetBucketMetricsConfigurationOutput action with Effect set to Allow.

Edit this page on GitHub

Thank you for your feedback!

×