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,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class TrafficMirrorFilterRule : CustomResource
Constructors
View SourceTrafficMirrorFilterRule(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 SourceDescription
A description of the traffic mirror filter rule.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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> |
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>> |
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> |
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> |
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> |
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> |
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> |
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 SourceGet(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 |