TrafficMirrorSession
Provides an Traffic mirror session.
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 target = new Aws.Ec2.TrafficMirrorTarget("target", new Aws.Ec2.TrafficMirrorTargetArgs
{
NetworkLoadBalancerArn = aws_lb.Lb.Arn,
});
var session = new Aws.Ec2.TrafficMirrorSession("session", new Aws.Ec2.TrafficMirrorSessionArgs
{
Description = "traffic mirror session - example",
NetworkInterfaceId = aws_instance.Test.Primary_network_interface_id,
TrafficMirrorFilterId = filter.Id,
TrafficMirrorTargetId = target.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
filter, err := ec2.NewTrafficMirrorFilter(ctx, "filter", &ec2.TrafficMirrorFilterArgs{
Description: pulumi.String("traffic mirror filter - example"),
NetworkServices: pulumi.StringArray{
pulumi.String("amazon-dns"),
},
})
if err != nil {
return err
}
target, err := ec2.NewTrafficMirrorTarget(ctx, "target", &ec2.TrafficMirrorTargetArgs{
NetworkLoadBalancerArn: pulumi.String(aws_lb.Lb.Arn),
})
if err != nil {
return err
}
_, err = ec2.NewTrafficMirrorSession(ctx, "session", &ec2.TrafficMirrorSessionArgs{
Description: pulumi.String("traffic mirror session - example"),
NetworkInterfaceId: pulumi.String(aws_instance.Test.Primary_network_interface_id),
TrafficMirrorFilterId: filter.ID(),
TrafficMirrorTargetId: target.ID(),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
filter = aws.ec2.TrafficMirrorFilter("filter",
description="traffic mirror filter - example",
network_services=["amazon-dns"])
target = aws.ec2.TrafficMirrorTarget("target", network_load_balancer_arn=aws_lb["lb"]["arn"])
session = aws.ec2.TrafficMirrorSession("session",
description="traffic mirror session - example",
network_interface_id=aws_instance["test"]["primary_network_interface_id"],
traffic_mirror_filter_id=filter.id,
traffic_mirror_target_id=target.id)import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const filter = new aws.ec2.TrafficMirrorFilter("filter", {
description: "traffic mirror filter - example",
networkServices: ["amazon-dns"],
});
const target = new aws.ec2.TrafficMirrorTarget("target", {
networkLoadBalancerArn: aws_lb_lb.arn,
});
const session = new aws.ec2.TrafficMirrorSession("session", {
description: "traffic mirror session - example",
networkInterfaceId: aws_instance_test.primaryNetworkInterfaceId,
trafficMirrorFilterId: filter.id,
trafficMirrorTargetId: target.id,
});Create a TrafficMirrorSession Resource
new TrafficMirrorSession(name: string, args: TrafficMirrorSessionArgs, opts?: CustomResourceOptions);def TrafficMirrorSession(resource_name, opts=None, description=None, network_interface_id=None, packet_length=None, session_number=None, tags=None, traffic_mirror_filter_id=None, traffic_mirror_target_id=None, virtual_network_id=None, __props__=None);func NewTrafficMirrorSession(ctx *Context, name string, args TrafficMirrorSessionArgs, opts ...ResourceOption) (*TrafficMirrorSession, error)public TrafficMirrorSession(string name, TrafficMirrorSessionArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args TrafficMirrorSessionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TrafficMirrorSessionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TrafficMirrorSessionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
TrafficMirrorSession Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The TrafficMirrorSession resource accepts the following input properties:
- Network
Interface stringId ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
- Session
Number int - The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
- Traffic
Mirror stringFilter Id ID of the traffic mirror filter to be used
- Traffic
Mirror stringTarget Id ID of the traffic mirror target to be used
- Description string
A description of the traffic mirror session.
- Packet
Length int The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
- Dictionary<string, string>
Key-value map of resource tags.
- Virtual
Network intId - The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
- Network
Interface stringId ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
- Session
Number int - The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
- Traffic
Mirror stringFilter Id ID of the traffic mirror filter to be used
- Traffic
Mirror stringTarget Id ID of the traffic mirror target to be used
- Description string
A description of the traffic mirror session.
- Packet
Length int The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
- map[string]string
Key-value map of resource tags.
- Virtual
Network intId - The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
- network
Interface stringId ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
- session
Number number - The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
- traffic
Mirror stringFilter Id ID of the traffic mirror filter to be used
- traffic
Mirror stringTarget Id ID of the traffic mirror target to be used
- description string
A description of the traffic mirror session.
- packet
Length number The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
- {[key: string]: string}
Key-value map of resource tags.
- virtual
Network numberId - The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
- network_
interface_ strid ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
- session_
number float - The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
- traffic_
mirror_ strfilter_ id ID of the traffic mirror filter to be used
- traffic_
mirror_ strtarget_ id ID of the traffic mirror target to be used
- description str
A description of the traffic mirror session.
- packet_
length float The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
- Dict[str, str]
Key-value map of resource tags.
- virtual_
network_ floatid - The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
Outputs
All input properties are implicitly available as output properties. Additionally, the TrafficMirrorSession resource produces the following output properties:
Look up an Existing TrafficMirrorSession Resource
Get an existing TrafficMirrorSession resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: TrafficMirrorSessionState, opts?: CustomResourceOptions): TrafficMirrorSessionstatic get(resource_name, id, opts=None, arn=None, description=None, network_interface_id=None, packet_length=None, session_number=None, tags=None, traffic_mirror_filter_id=None, traffic_mirror_target_id=None, virtual_network_id=None, __props__=None);func GetTrafficMirrorSession(ctx *Context, name string, id IDInput, state *TrafficMirrorSessionState, opts ...ResourceOption) (*TrafficMirrorSession, error)public static TrafficMirrorSession Get(string name, Input<string> id, TrafficMirrorSessionState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Arn string
The ARN of the traffic mirror session.
- Description string
A description of the traffic mirror session.
- Network
Interface stringId ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
- Packet
Length int The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
- Session
Number int - The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
- Dictionary<string, string>
Key-value map of resource tags.
- Traffic
Mirror stringFilter Id ID of the traffic mirror filter to be used
- Traffic
Mirror stringTarget Id ID of the traffic mirror target to be used
- Virtual
Network intId - The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
- Arn string
The ARN of the traffic mirror session.
- Description string
A description of the traffic mirror session.
- Network
Interface stringId ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
- Packet
Length int The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
- Session
Number int - The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
- map[string]string
Key-value map of resource tags.
- Traffic
Mirror stringFilter Id ID of the traffic mirror filter to be used
- Traffic
Mirror stringTarget Id ID of the traffic mirror target to be used
- Virtual
Network intId - The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
- arn string
The ARN of the traffic mirror session.
- description string
A description of the traffic mirror session.
- network
Interface stringId ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
- packet
Length number The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
- session
Number number - The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
- {[key: string]: string}
Key-value map of resource tags.
- traffic
Mirror stringFilter Id ID of the traffic mirror filter to be used
- traffic
Mirror stringTarget Id ID of the traffic mirror target to be used
- virtual
Network numberId - The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
- arn str
The ARN of the traffic mirror session.
- description str
A description of the traffic mirror session.
- network_
interface_ strid ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
- packet_
length float The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
- session_
number float - The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
- Dict[str, str]
Key-value map of resource tags.
- traffic_
mirror_ strfilter_ id ID of the traffic mirror filter to be used
- traffic_
mirror_ strtarget_ id ID of the traffic mirror target to be used
- virtual_
network_ floatid - The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.