pulumi_wasm_providers_aws_mini::ec2

Module traffic_mirror_session

source
Expand description

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

§Example Usage

To create a basic traffic mirror session

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let filter = traffic_mirror_filter::create(
        "filter",
        TrafficMirrorFilterArgs::builder()
            .description("traffic mirror filter - example")
            .network_services(vec!["amazon-dns",])
            .build_struct(),
    );
    let session = traffic_mirror_session::create(
        "session",
        TrafficMirrorSessionArgs::builder()
            .description("traffic mirror session - example")
            .network_interface_id("${test.primaryNetworkInterfaceId}")
            .session_number(1)
            .traffic_mirror_filter_id("${filter.id}")
            .traffic_mirror_target_id("${target.id}")
            .build_struct(),
    );
    let target = traffic_mirror_target::create(
        "target",
        TrafficMirrorTargetArgs::builder()
            .network_load_balancer_arn("${lb.arn}")
            .build_struct(),
    );
}

§Import

Using pulumi import, import traffic mirror sessions using the id. For example:

$ pulumi import aws:ec2/trafficMirrorSession:TrafficMirrorSession session tms-0d8aa3ca35897b82e

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments