AWS Amazon EC2 Traffic Mirror Filter

This page shows how to write Terraform and CloudFormation for Amazon EC2 Traffic Mirror Filter and write them securely.

code-icon

Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.

get-started-button

Terraform Example (aws_ec2_traffic_mirror_filter)

Provides an Traffic mirror filter.
Read limits and considerations for traffic mirroring

Parameters

Example Usage (from GitHub)

github-iconniveklabs/aws
resource "aws_ec2_traffic_mirror_filter" "this" {
  description      = var.description
  network_services = var.network_services
  tags             = var.tags
}

github-iconJamesWoolfenden/terraform-aws-trafficmirror
resource "aws_ec2_traffic_mirror_filter" "filter" {
  description      = var.filter_description
  network_services = ["amazon-dns"]
  tags             = var.common_tags
}
github-iconhands-on-cloud/amazon-vpc-traffic-inspection-and-monitoring
resource "aws_ec2_traffic_mirror_filter" "filter" {}

resource "aws_ec2_traffic_mirror_filter_rule" "https" {
  traffic_mirror_filter_id = aws_ec2_traffic_mirror_filter.filter.id
  destination_cidr_block   = "0.0.0.0/0"
  source_cidr_block        = "10.0.0.0/8"
github-iconjazhans/terraform_modules
resource "aws_ec2_traffic_mirror_filter" "module_filter" {
  description = var.mirror_filt_desc
}
resource "aws_ec2_traffic_mirror_filter_rule" "module_outbound" {
  description              = "Capture all outbound"
  traffic_mirror_filter_id = aws_ec2_traffic_mirror_filter.module_filter.id
github-iconjazhans/terraform_modules
resource "aws_ec2_traffic_mirror_filter" "module_filter" {
  description = var.mirror_filt_desc
}
resource "aws_ec2_traffic_mirror_filter_rule" "module_outbound" {
  description              = "Capture all outbound"
  traffic_mirror_filter_id = aws_ec2_traffic_mirror_filter.module_filter.id

CloudFormation Example (AWS::EC2::TrafficMirrorFilter)

Specifies a Traffic Mirror filter.

A Traffic Mirror filter is a set of rules that defines the traffic to mirror.

By default, no traffic is mirrored. To mirror traffic, use AWS::EC2::TrafficMirrorFilterRule to add Traffic Mirror rules to the filter. The rules you add define what traffic gets mirrored.

Parameters

Frequently asked questions

What is AWS Amazon EC2 Traffic Mirror Filter?

AWS Amazon EC2 Traffic Mirror Filter is a resource for Amazon EC2 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon EC2 Traffic Mirror Filter?

For Terraform, the niveklabs/aws, JamesWoolfenden/terraform-aws-trafficmirror and hands-on-cloud/amazon-vpc-traffic-inspection-and-monitoring source code examples are useful. See the Terraform Example section for further details.