Skip to main content

aws_ec2_traffic_mirror_filters Resource

[edit on GitHub]

Use the aws_ec2_traffic_mirror_filters InSpec audit resource to test properties of multiple AWS traffic mirror filters.

Installation

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

See the Chef InSpec documentation on cloud platforms for information on configuring your AWS environment for InSpec and creating an InSpec profile that uses the InSpec AWS resource pack.

Syntax

An aws_ec2_traffic_mirror_filters resource block declares the tests for a set of AWS traffic mirror filters.

describe aws_ec2_traffic_mirror_filters do
  it { should exist }
end

Parameters

This resource does not require any parameters.

Properties

traffic_mirror_filter_ids
The ID of a traffic mirror filter.
descriptions
The description of a traffic mirror filter.
tags
A list of hashes with each key-value pair corresponding to an traffic mirror filter.

There are also additional properties available. For a comprehensive list, see the API reference documentation

Examples

Test that an EC2 traffic mirror filter exists.

describe aws_ec2_traffic_mirror_filters do
  it { should exist }
end

Test that EC2 traffic mirror filter’s description is correct.

describe aws_ec2_traffic_mirror_filters do
  its('descriptions') { should include 'DESCRIPTION_TEXT' }
end

Test that an EC2 traffic mirror has the correct tag.

describe aws_ec2_traffic_mirror_filters do
  its('tags') { should include 'TAG' }
end

Matchers

This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.

The controls will pass if the describe method returns at least one result.

exist

Use should to test that an entity exists.

describe aws_ec2_traffic_mirror_filters do
  it { should exist }
end

Use should_not to test that an entity does not exist.

describe aws_ec2_traffic_mirror_filters do
  it { should_not exist }
end

AWS Permissions

Your Principal will need the EC2:Client:DescribeTrafficMirrorFiltersResult action with Effect set to Allow.

See the Actions, Resources, and Condition Keys for Amazon EC2 documentation for additional information.

Was this page helpful?

×









Search Results