Skip to main content

aws_ec2_traffic_mirror_filters Resource

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

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

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

For a full list of available matchers, see 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.

Edit this page on GitHub

Thank you for your feedback!

×