Show / Hide Table of Contents

Class TrafficMirrorFilterRule

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

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var filter = new Aws.Ec2.TrafficMirrorFilter("filter", new Aws.Ec2.TrafficMirrorFilterArgs
    {
        Description = "traffic mirror filter - example",
        NetworkServices = 
        {
            "amazon-dns",
        },
    });
    var ruleout = new Aws.Ec2.TrafficMirrorFilterRule("ruleout", new Aws.Ec2.TrafficMirrorFilterRuleArgs
    {
        Description = "test rule",
        DestinationCidrBlock = "10.0.0.0/8",
        RuleAction = "accept",
        RuleNumber = 1,
        SourceCidrBlock = "10.0.0.0/8",
        TrafficDirection = "egress",
        TrafficMirrorFilterId = filter.Id,
    });
    var rulein = new Aws.Ec2.TrafficMirrorFilterRule("rulein", new Aws.Ec2.TrafficMirrorFilterRuleArgs
    {
        Description = "test rule",
        DestinationCidrBlock = "10.0.0.0/8",
        DestinationPortRange = new Aws.Ec2.Inputs.TrafficMirrorFilterRuleDestinationPortRangeArgs
        {
            FromPort = 22,
            ToPort = 53,
        },
        Protocol = 6,
        RuleAction = "accept",
        RuleNumber = 1,
        SourceCidrBlock = "10.0.0.0/8",
        SourcePortRange = new Aws.Ec2.Inputs.TrafficMirrorFilterRuleSourcePortRangeArgs
        {
            FromPort = 0,
            ToPort = 10,
        },
        TrafficDirection = "ingress",
        TrafficMirrorFilterId = filter.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
TrafficMirrorFilterRule
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class TrafficMirrorFilterRule : CustomResource

Constructors

View Source

TrafficMirrorFilterRule(String, TrafficMirrorFilterRuleArgs, CustomResourceOptions)

Create a TrafficMirrorFilterRule resource with the given unique name, arguments, and options.

Declaration
public TrafficMirrorFilterRule(string name, TrafficMirrorFilterRuleArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

TrafficMirrorFilterRuleArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Description

A description of the traffic mirror filter rule.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

DestinationCidrBlock

The destination CIDR block to assign to the Traffic Mirror rule.

Declaration
public Output<string> DestinationCidrBlock { get; }
Property Value
Type Description
Output<System.String>
View Source

DestinationPortRange

The destination port range. Supported only when the protocol is set to TCP(6) or UDP(17). See Traffic mirror port range documented below

Declaration
public Output<TrafficMirrorFilterRuleDestinationPortRange> DestinationPortRange { get; }
Property Value
Type Description
Output<TrafficMirrorFilterRuleDestinationPortRange>
View Source

Protocol

The protocol number, for example 17 (UDP), to assign to the Traffic Mirror rule. For information about the protocol value, see Protocol Numbers on the Internet Assigned Numbers Authority (IANA) website.

Declaration
public Output<int?> Protocol { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

RuleAction

The action to take (accept | reject) on the filtered traffic. Valid values are accept and reject

Declaration
public Output<string> RuleAction { get; }
Property Value
Type Description
Output<System.String>
View Source

RuleNumber

The number of the Traffic Mirror rule. This number must be unique for each Traffic Mirror rule in a given direction. The rules are processed in ascending order by rule number.

Declaration
public Output<int> RuleNumber { get; }
Property Value
Type Description
Output<System.Int32>
View Source

SourceCidrBlock

The source CIDR block to assign to the Traffic Mirror rule.

Declaration
public Output<string> SourceCidrBlock { get; }
Property Value
Type Description
Output<System.String>
View Source

SourcePortRange

The source port range. Supported only when the protocol is set to TCP(6) or UDP(17). See Traffic mirror port range documented below

Declaration
public Output<TrafficMirrorFilterRuleSourcePortRange> SourcePortRange { get; }
Property Value
Type Description
Output<TrafficMirrorFilterRuleSourcePortRange>
View Source

TrafficDirection

The direction of traffic to be captured. Valid values are ingress and egress

Declaration
public Output<string> TrafficDirection { get; }
Property Value
Type Description
Output<System.String>
View Source

TrafficMirrorFilterId

ID of the traffic mirror filter to which this rule should be added

Declaration
public Output<string> TrafficMirrorFilterId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, TrafficMirrorFilterRuleState, CustomResourceOptions)

Get an existing TrafficMirrorFilterRule resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static TrafficMirrorFilterRule Get(string name, Input<string> id, TrafficMirrorFilterRuleState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

TrafficMirrorFilterRuleState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
TrafficMirrorFilterRule
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.