1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. vpc
  5. TrafficMirrorSession
Alibaba Cloud v3.45.1 published on Thursday, Dec 7, 2023 by Pulumi

alicloud.vpc.TrafficMirrorSession

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.45.1 published on Thursday, Dec 7, 2023 by Pulumi

    Provides a VPC Traffic Mirror Session resource. Traffic mirroring session.

    For information about VPC Traffic Mirror Session and how to use it, see What is Traffic Mirror Session.

    NOTE: Available since v1.142.0.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var defaultInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
        {
            InstanceTypeFamily = "ecs.g7",
        });
    
        var defaultZones = AliCloud.GetZones.Invoke(new()
        {
            AvailableResourceCreation = "Instance",
            AvailableInstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
        {
            VpcName = name,
            CidrBlock = "10.4.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
        {
            VswitchName = name,
            CidrBlock = "10.4.0.0/24",
            VpcId = defaultNetwork.Id,
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
        });
    
        var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new()
        {
            Description = name,
            VpcId = defaultNetwork.Id,
        });
    
        var defaultImages = AliCloud.Ecs.GetImages.Invoke(new()
        {
            NameRegex = "^ubuntu_[0-9]+_[0-9]+_x64*",
            MostRecent = true,
            Owners = "system",
        });
    
        var defaultInstance = new List<AliCloud.Ecs.Instance>();
        for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultInstance.Add(new AliCloud.Ecs.Instance($"defaultInstance-{range.Value}", new()
            {
                AvailabilityZone = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
                InstanceName = name,
                HostName = name,
                ImageId = defaultImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
                InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
                SecurityGroups = new[]
                {
                    defaultSecurityGroup.Id,
                },
                VswitchId = defaultSwitch.Id,
                SystemDiskCategory = "cloud_essd",
            }));
        }
        var defaultEcsNetworkInterface = new List<AliCloud.Ecs.EcsNetworkInterface>();
        for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultEcsNetworkInterface.Add(new AliCloud.Ecs.EcsNetworkInterface($"defaultEcsNetworkInterface-{range.Value}", new()
            {
                NetworkInterfaceName = name,
                VswitchId = defaultSwitch.Id,
                SecurityGroupIds = new[]
                {
                    defaultSecurityGroup.Id,
                },
            }));
        }
        var defaultEcsNetworkInterfaceAttachment = new List<AliCloud.Ecs.EcsNetworkInterfaceAttachment>();
        for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultEcsNetworkInterfaceAttachment.Add(new AliCloud.Ecs.EcsNetworkInterfaceAttachment($"defaultEcsNetworkInterfaceAttachment-{range.Value}", new()
            {
                InstanceId = defaultInstance[range.Value].Id,
                NetworkInterfaceId = defaultEcsNetworkInterface[range.Value].Id,
            }));
        }
        var defaultTrafficMirrorFilter = new AliCloud.Vpc.TrafficMirrorFilter("defaultTrafficMirrorFilter", new()
        {
            TrafficMirrorFilterName = name,
            TrafficMirrorFilterDescription = name,
        });
    
        var defaultTrafficMirrorSession = new AliCloud.Vpc.TrafficMirrorSession("defaultTrafficMirrorSession", new()
        {
            Priority = 1,
            VirtualNetworkId = 10,
            TrafficMirrorSessionDescription = name,
            TrafficMirrorSessionName = name,
            TrafficMirrorTargetId = defaultEcsNetworkInterfaceAttachment[0].NetworkInterfaceId,
            TrafficMirrorSourceIds = new[]
            {
                defaultEcsNetworkInterfaceAttachment[1].NetworkInterfaceId,
            },
            TrafficMirrorFilterId = defaultTrafficMirrorFilter.Id,
            TrafficMirrorTargetType = "NetworkInterface",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
    			InstanceTypeFamily: pulumi.StringRef("ecs.g7"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("Instance"),
    			AvailableInstanceType:     pulumi.StringRef(defaultInstanceTypes.InstanceTypes[0].Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("10.4.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
    			VswitchName: pulumi.String(name),
    			CidrBlock:   pulumi.String("10.4.0.0/24"),
    			VpcId:       defaultNetwork.ID(),
    			ZoneId:      *pulumi.String(defaultZones.Zones[0].Id),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "defaultSecurityGroup", &ecs.SecurityGroupArgs{
    			Description: pulumi.String(name),
    			VpcId:       defaultNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
    			NameRegex:  pulumi.StringRef("^ubuntu_[0-9]+_[0-9]+_x64*"),
    			MostRecent: pulumi.BoolRef(true),
    			Owners:     pulumi.StringRef("system"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		var defaultInstance []*ecs.Instance
    		for index := 0; index < 2; index++ {
    			key0 := index
    			_ := index
    			__res, err := ecs.NewInstance(ctx, fmt.Sprintf("defaultInstance-%v", key0), &ecs.InstanceArgs{
    				AvailabilityZone: *pulumi.String(defaultZones.Zones[0].Id),
    				InstanceName:     pulumi.String(name),
    				HostName:         pulumi.String(name),
    				ImageId:          *pulumi.String(defaultImages.Images[0].Id),
    				InstanceType:     *pulumi.String(defaultInstanceTypes.InstanceTypes[0].Id),
    				SecurityGroups: pulumi.StringArray{
    					defaultSecurityGroup.ID(),
    				},
    				VswitchId:          defaultSwitch.ID(),
    				SystemDiskCategory: pulumi.String("cloud_essd"),
    			})
    			if err != nil {
    				return err
    			}
    			defaultInstance = append(defaultInstance, __res)
    		}
    		var defaultEcsNetworkInterface []*ecs.EcsNetworkInterface
    		for index := 0; index < 2; index++ {
    			key0 := index
    			_ := index
    			__res, err := ecs.NewEcsNetworkInterface(ctx, fmt.Sprintf("defaultEcsNetworkInterface-%v", key0), &ecs.EcsNetworkInterfaceArgs{
    				NetworkInterfaceName: pulumi.String(name),
    				VswitchId:            defaultSwitch.ID(),
    				SecurityGroupIds: pulumi.StringArray{
    					defaultSecurityGroup.ID(),
    				},
    			})
    			if err != nil {
    				return err
    			}
    			defaultEcsNetworkInterface = append(defaultEcsNetworkInterface, __res)
    		}
    		var defaultEcsNetworkInterfaceAttachment []*ecs.EcsNetworkInterfaceAttachment
    		for index := 0; index < 2; index++ {
    			key0 := index
    			val0 := index
    			__res, err := ecs.NewEcsNetworkInterfaceAttachment(ctx, fmt.Sprintf("defaultEcsNetworkInterfaceAttachment-%v", key0), &ecs.EcsNetworkInterfaceAttachmentArgs{
    				InstanceId:         defaultInstance[val0].ID(),
    				NetworkInterfaceId: defaultEcsNetworkInterface[val0].ID(),
    			})
    			if err != nil {
    				return err
    			}
    			defaultEcsNetworkInterfaceAttachment = append(defaultEcsNetworkInterfaceAttachment, __res)
    		}
    		defaultTrafficMirrorFilter, err := vpc.NewTrafficMirrorFilter(ctx, "defaultTrafficMirrorFilter", &vpc.TrafficMirrorFilterArgs{
    			TrafficMirrorFilterName:        pulumi.String(name),
    			TrafficMirrorFilterDescription: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewTrafficMirrorSession(ctx, "defaultTrafficMirrorSession", &vpc.TrafficMirrorSessionArgs{
    			Priority:                        pulumi.Int(1),
    			VirtualNetworkId:                pulumi.Int(10),
    			TrafficMirrorSessionDescription: pulumi.String(name),
    			TrafficMirrorSessionName:        pulumi.String(name),
    			TrafficMirrorTargetId:           defaultEcsNetworkInterfaceAttachment[0].NetworkInterfaceId,
    			TrafficMirrorSourceIds: pulumi.StringArray{
    				defaultEcsNetworkInterfaceAttachment[1].NetworkInterfaceId,
    			},
    			TrafficMirrorFilterId:   defaultTrafficMirrorFilter.ID(),
    			TrafficMirrorTargetType: pulumi.String("NetworkInterface"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetZonesArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.ecs.SecurityGroup;
    import com.pulumi.alicloud.ecs.SecurityGroupArgs;
    import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
    import com.pulumi.alicloud.ecs.Instance;
    import com.pulumi.alicloud.ecs.InstanceArgs;
    import com.pulumi.alicloud.ecs.EcsNetworkInterface;
    import com.pulumi.alicloud.ecs.EcsNetworkInterfaceArgs;
    import com.pulumi.alicloud.ecs.EcsNetworkInterfaceAttachment;
    import com.pulumi.alicloud.ecs.EcsNetworkInterfaceAttachmentArgs;
    import com.pulumi.alicloud.vpc.TrafficMirrorFilter;
    import com.pulumi.alicloud.vpc.TrafficMirrorFilterArgs;
    import com.pulumi.alicloud.vpc.TrafficMirrorSession;
    import com.pulumi.alicloud.vpc.TrafficMirrorSessionArgs;
    import com.pulumi.codegen.internal.KeyedValue;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("tf-example");
            final var defaultInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
                .instanceTypeFamily("ecs.g7")
                .build());
    
            final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("Instance")
                .availableInstanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()        
                .vpcName(name)
                .cidrBlock("10.4.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()        
                .vswitchName(name)
                .cidrBlock("10.4.0.0/24")
                .vpcId(defaultNetwork.id())
                .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .build());
    
            var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()        
                .description(name)
                .vpcId(defaultNetwork.id())
                .build());
    
            final var defaultImages = EcsFunctions.getImages(GetImagesArgs.builder()
                .nameRegex("^ubuntu_[0-9]+_[0-9]+_x64*")
                .mostRecent(true)
                .owners("system")
                .build());
    
            for (var i = 0; i < 2; i++) {
                new Instance("defaultInstance-" + i, InstanceArgs.builder()            
                    .availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                    .instanceName(name)
                    .hostName(name)
                    .imageId(defaultImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
                    .instanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
                    .securityGroups(defaultSecurityGroup.id())
                    .vswitchId(defaultSwitch.id())
                    .systemDiskCategory("cloud_essd")
                    .build());
    
            
    }
            for (var i = 0; i < 2; i++) {
                new EcsNetworkInterface("defaultEcsNetworkInterface-" + i, EcsNetworkInterfaceArgs.builder()            
                    .networkInterfaceName(name)
                    .vswitchId(defaultSwitch.id())
                    .securityGroupIds(defaultSecurityGroup.id())
                    .build());
    
            
    }
            for (var i = 0; i < 2; i++) {
                new EcsNetworkInterfaceAttachment("defaultEcsNetworkInterfaceAttachment-" + i, EcsNetworkInterfaceAttachmentArgs.builder()            
                    .instanceId(defaultInstance[range.value()].id())
                    .networkInterfaceId(defaultEcsNetworkInterface[range.value()].id())
                    .build());
    
            
    }
            var defaultTrafficMirrorFilter = new TrafficMirrorFilter("defaultTrafficMirrorFilter", TrafficMirrorFilterArgs.builder()        
                .trafficMirrorFilterName(name)
                .trafficMirrorFilterDescription(name)
                .build());
    
            var defaultTrafficMirrorSession = new TrafficMirrorSession("defaultTrafficMirrorSession", TrafficMirrorSessionArgs.builder()        
                .priority(1)
                .virtualNetworkId(10)
                .trafficMirrorSessionDescription(name)
                .trafficMirrorSessionName(name)
                .trafficMirrorTargetId(defaultEcsNetworkInterfaceAttachment[0].networkInterfaceId())
                .trafficMirrorSourceIds(defaultEcsNetworkInterfaceAttachment[1].networkInterfaceId())
                .trafficMirrorFilterId(defaultTrafficMirrorFilter.id())
                .trafficMirrorTargetType("NetworkInterface")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default_instance_types = alicloud.ecs.get_instance_types(instance_type_family="ecs.g7")
    default_zones = alicloud.get_zones(available_resource_creation="Instance",
        available_instance_type=default_instance_types.instance_types[0].id)
    default_network = alicloud.vpc.Network("defaultNetwork",
        vpc_name=name,
        cidr_block="10.4.0.0/16")
    default_switch = alicloud.vpc.Switch("defaultSwitch",
        vswitch_name=name,
        cidr_block="10.4.0.0/24",
        vpc_id=default_network.id,
        zone_id=default_zones.zones[0].id)
    default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup",
        description=name,
        vpc_id=default_network.id)
    default_images = alicloud.ecs.get_images(name_regex="^ubuntu_[0-9]+_[0-9]+_x64*",
        most_recent=True,
        owners="system")
    default_instance = []
    for range in [{"value": i} for i in range(0, 2)]:
        default_instance.append(alicloud.ecs.Instance(f"defaultInstance-{range['value']}",
            availability_zone=default_zones.zones[0].id,
            instance_name=name,
            host_name=name,
            image_id=default_images.images[0].id,
            instance_type=default_instance_types.instance_types[0].id,
            security_groups=[default_security_group.id],
            vswitch_id=default_switch.id,
            system_disk_category="cloud_essd"))
    default_ecs_network_interface = []
    for range in [{"value": i} for i in range(0, 2)]:
        default_ecs_network_interface.append(alicloud.ecs.EcsNetworkInterface(f"defaultEcsNetworkInterface-{range['value']}",
            network_interface_name=name,
            vswitch_id=default_switch.id,
            security_group_ids=[default_security_group.id]))
    default_ecs_network_interface_attachment = []
    for range in [{"value": i} for i in range(0, 2)]:
        default_ecs_network_interface_attachment.append(alicloud.ecs.EcsNetworkInterfaceAttachment(f"defaultEcsNetworkInterfaceAttachment-{range['value']}",
            instance_id=default_instance[range["value"]].id,
            network_interface_id=default_ecs_network_interface[range["value"]].id))
    default_traffic_mirror_filter = alicloud.vpc.TrafficMirrorFilter("defaultTrafficMirrorFilter",
        traffic_mirror_filter_name=name,
        traffic_mirror_filter_description=name)
    default_traffic_mirror_session = alicloud.vpc.TrafficMirrorSession("defaultTrafficMirrorSession",
        priority=1,
        virtual_network_id=10,
        traffic_mirror_session_description=name,
        traffic_mirror_session_name=name,
        traffic_mirror_target_id=default_ecs_network_interface_attachment[0].network_interface_id,
        traffic_mirror_source_ids=[default_ecs_network_interface_attachment[1].network_interface_id],
        traffic_mirror_filter_id=default_traffic_mirror_filter.id,
        traffic_mirror_target_type="NetworkInterface")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const defaultInstanceTypes = alicloud.ecs.getInstanceTypes({
        instanceTypeFamily: "ecs.g7",
    });
    const defaultZones = defaultInstanceTypes.then(defaultInstanceTypes => alicloud.getZones({
        availableResourceCreation: "Instance",
        availableInstanceType: defaultInstanceTypes.instanceTypes?.[0]?.id,
    }));
    const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
        vpcName: name,
        cidrBlock: "10.4.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
        vswitchName: name,
        cidrBlock: "10.4.0.0/24",
        vpcId: defaultNetwork.id,
        zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
    });
    const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("defaultSecurityGroup", {
        description: name,
        vpcId: defaultNetwork.id,
    });
    const defaultImages = alicloud.ecs.getImages({
        nameRegex: "^ubuntu_[0-9]+_[0-9]+_x64*",
        mostRecent: true,
        owners: "system",
    });
    const defaultInstance: alicloud.ecs.Instance[] = [];
    for (const range = {value: 0}; range.value < 2; range.value++) {
        defaultInstance.push(new alicloud.ecs.Instance(`defaultInstance-${range.value}`, {
            availabilityZone: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
            instanceName: name,
            hostName: name,
            imageId: defaultImages.then(defaultImages => defaultImages.images?.[0]?.id),
            instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.instanceTypes?.[0]?.id),
            securityGroups: [defaultSecurityGroup.id],
            vswitchId: defaultSwitch.id,
            systemDiskCategory: "cloud_essd",
        }));
    }
    const defaultEcsNetworkInterface: alicloud.ecs.EcsNetworkInterface[] = [];
    for (const range = {value: 0}; range.value < 2; range.value++) {
        defaultEcsNetworkInterface.push(new alicloud.ecs.EcsNetworkInterface(`defaultEcsNetworkInterface-${range.value}`, {
            networkInterfaceName: name,
            vswitchId: defaultSwitch.id,
            securityGroupIds: [defaultSecurityGroup.id],
        }));
    }
    const defaultEcsNetworkInterfaceAttachment: alicloud.ecs.EcsNetworkInterfaceAttachment[] = [];
    for (const range = {value: 0}; range.value < 2; range.value++) {
        defaultEcsNetworkInterfaceAttachment.push(new alicloud.ecs.EcsNetworkInterfaceAttachment(`defaultEcsNetworkInterfaceAttachment-${range.value}`, {
            instanceId: defaultInstance[range.value].id,
            networkInterfaceId: defaultEcsNetworkInterface[range.value].id,
        }));
    }
    const defaultTrafficMirrorFilter = new alicloud.vpc.TrafficMirrorFilter("defaultTrafficMirrorFilter", {
        trafficMirrorFilterName: name,
        trafficMirrorFilterDescription: name,
    });
    const defaultTrafficMirrorSession = new alicloud.vpc.TrafficMirrorSession("defaultTrafficMirrorSession", {
        priority: 1,
        virtualNetworkId: 10,
        trafficMirrorSessionDescription: name,
        trafficMirrorSessionName: name,
        trafficMirrorTargetId: defaultEcsNetworkInterfaceAttachment[0].networkInterfaceId,
        trafficMirrorSourceIds: [defaultEcsNetworkInterfaceAttachment[1].networkInterfaceId],
        trafficMirrorFilterId: defaultTrafficMirrorFilter.id,
        trafficMirrorTargetType: "NetworkInterface",
    });
    

    Coming soon!

    Create TrafficMirrorSession Resource

    new TrafficMirrorSession(name: string, args: TrafficMirrorSessionArgs, opts?: CustomResourceOptions);
    @overload
    def TrafficMirrorSession(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             dry_run: Optional[bool] = None,
                             enabled: Optional[bool] = None,
                             packet_length: Optional[int] = None,
                             priority: Optional[int] = None,
                             resource_group_id: Optional[str] = None,
                             tags: Optional[Mapping[str, Any]] = None,
                             traffic_mirror_filter_id: Optional[str] = None,
                             traffic_mirror_session_description: Optional[str] = None,
                             traffic_mirror_session_name: Optional[str] = None,
                             traffic_mirror_source_ids: Optional[Sequence[str]] = None,
                             traffic_mirror_target_id: Optional[str] = None,
                             traffic_mirror_target_type: Optional[str] = None,
                             virtual_network_id: Optional[int] = None)
    @overload
    def TrafficMirrorSession(resource_name: str,
                             args: TrafficMirrorSessionArgs,
                             opts: Optional[ResourceOptions] = None)
    func NewTrafficMirrorSession(ctx *Context, name string, args TrafficMirrorSessionArgs, opts ...ResourceOption) (*TrafficMirrorSession, error)
    public TrafficMirrorSession(string name, TrafficMirrorSessionArgs args, CustomResourceOptions? opts = null)
    public TrafficMirrorSession(String name, TrafficMirrorSessionArgs args)
    public TrafficMirrorSession(String name, TrafficMirrorSessionArgs args, CustomResourceOptions options)
    
    type: alicloud:vpc:TrafficMirrorSession
    properties: # The arguments to resource properties.
    options: # 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.
    resource_name str
    The unique name of the resource.
    args TrafficMirrorSessionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control 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.
    name String
    The unique name of the resource.
    args TrafficMirrorSessionArgs
    The arguments to resource properties.
    options 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 Architecture and Concepts docs.

    Inputs

    The TrafficMirrorSession resource accepts the following input properties:

    Priority int

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    TrafficMirrorFilterId string

    The ID of the filter.

    TrafficMirrorSourceIds List<string>

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    TrafficMirrorTargetId string

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    TrafficMirrorTargetType string

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    DryRun bool

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    Enabled bool

    Specifies whether to enable traffic mirror sessions. default to false.

    PacketLength int

    Maximum Transmission Unit (MTU).

    ResourceGroupId string

    The ID of the resource group.

    Tags Dictionary<string, object>

    The tags of this resource.

    TrafficMirrorSessionDescription string

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    TrafficMirrorSessionName string

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    VirtualNetworkId int

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    Priority int

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    TrafficMirrorFilterId string

    The ID of the filter.

    TrafficMirrorSourceIds []string

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    TrafficMirrorTargetId string

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    TrafficMirrorTargetType string

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    DryRun bool

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    Enabled bool

    Specifies whether to enable traffic mirror sessions. default to false.

    PacketLength int

    Maximum Transmission Unit (MTU).

    ResourceGroupId string

    The ID of the resource group.

    Tags map[string]interface{}

    The tags of this resource.

    TrafficMirrorSessionDescription string

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    TrafficMirrorSessionName string

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    VirtualNetworkId int

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    priority Integer

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    trafficMirrorFilterId String

    The ID of the filter.

    trafficMirrorSourceIds List<String>

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    trafficMirrorTargetId String

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    trafficMirrorTargetType String

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    dryRun Boolean

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    enabled Boolean

    Specifies whether to enable traffic mirror sessions. default to false.

    packetLength Integer

    Maximum Transmission Unit (MTU).

    resourceGroupId String

    The ID of the resource group.

    tags Map<String,Object>

    The tags of this resource.

    trafficMirrorSessionDescription String

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    trafficMirrorSessionName String

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    virtualNetworkId Integer

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    priority number

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    trafficMirrorFilterId string

    The ID of the filter.

    trafficMirrorSourceIds string[]

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    trafficMirrorTargetId string

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    trafficMirrorTargetType string

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    dryRun boolean

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    enabled boolean

    Specifies whether to enable traffic mirror sessions. default to false.

    packetLength number

    Maximum Transmission Unit (MTU).

    resourceGroupId string

    The ID of the resource group.

    tags {[key: string]: any}

    The tags of this resource.

    trafficMirrorSessionDescription string

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    trafficMirrorSessionName string

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    virtualNetworkId number

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    priority int

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    traffic_mirror_filter_id str

    The ID of the filter.

    traffic_mirror_source_ids Sequence[str]

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    traffic_mirror_target_id str

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    traffic_mirror_target_type str

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    dry_run bool

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    enabled bool

    Specifies whether to enable traffic mirror sessions. default to false.

    packet_length int

    Maximum Transmission Unit (MTU).

    resource_group_id str

    The ID of the resource group.

    tags Mapping[str, Any]

    The tags of this resource.

    traffic_mirror_session_description str

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    traffic_mirror_session_name str

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    virtual_network_id int

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    priority Number

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    trafficMirrorFilterId String

    The ID of the filter.

    trafficMirrorSourceIds List<String>

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    trafficMirrorTargetId String

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    trafficMirrorTargetType String

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    dryRun Boolean

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    enabled Boolean

    Specifies whether to enable traffic mirror sessions. default to false.

    packetLength Number

    Maximum Transmission Unit (MTU).

    resourceGroupId String

    The ID of the resource group.

    tags Map<Any>

    The tags of this resource.

    trafficMirrorSessionDescription String

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    trafficMirrorSessionName String

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    virtualNetworkId Number

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TrafficMirrorSession resource produces the following output properties:

    Id string

    The provider-assigned unique ID for this managed resource.

    Status string

    The status of the resource.

    Id string

    The provider-assigned unique ID for this managed resource.

    Status string

    The status of the resource.

    id String

    The provider-assigned unique ID for this managed resource.

    status String

    The status of the resource.

    id string

    The provider-assigned unique ID for this managed resource.

    status string

    The status of the resource.

    id str

    The provider-assigned unique ID for this managed resource.

    status str

    The status of the resource.

    id String

    The provider-assigned unique ID for this managed resource.

    status String

    The status of the resource.

    Look up 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): TrafficMirrorSession
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dry_run: Optional[bool] = None,
            enabled: Optional[bool] = None,
            packet_length: Optional[int] = None,
            priority: Optional[int] = None,
            resource_group_id: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, Any]] = None,
            traffic_mirror_filter_id: Optional[str] = None,
            traffic_mirror_session_description: Optional[str] = None,
            traffic_mirror_session_name: Optional[str] = None,
            traffic_mirror_source_ids: Optional[Sequence[str]] = None,
            traffic_mirror_target_id: Optional[str] = None,
            traffic_mirror_target_type: Optional[str] = None,
            virtual_network_id: Optional[int] = None) -> TrafficMirrorSession
    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)
    public static TrafficMirrorSession get(String name, Output<String> id, TrafficMirrorSessionState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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:
    DryRun bool

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    Enabled bool

    Specifies whether to enable traffic mirror sessions. default to false.

    PacketLength int

    Maximum Transmission Unit (MTU).

    Priority int

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    ResourceGroupId string

    The ID of the resource group.

    Status string

    The status of the resource.

    Tags Dictionary<string, object>

    The tags of this resource.

    TrafficMirrorFilterId string

    The ID of the filter.

    TrafficMirrorSessionDescription string

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    TrafficMirrorSessionName string

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    TrafficMirrorSourceIds List<string>

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    TrafficMirrorTargetId string

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    TrafficMirrorTargetType string

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    VirtualNetworkId int

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    DryRun bool

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    Enabled bool

    Specifies whether to enable traffic mirror sessions. default to false.

    PacketLength int

    Maximum Transmission Unit (MTU).

    Priority int

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    ResourceGroupId string

    The ID of the resource group.

    Status string

    The status of the resource.

    Tags map[string]interface{}

    The tags of this resource.

    TrafficMirrorFilterId string

    The ID of the filter.

    TrafficMirrorSessionDescription string

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    TrafficMirrorSessionName string

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    TrafficMirrorSourceIds []string

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    TrafficMirrorTargetId string

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    TrafficMirrorTargetType string

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    VirtualNetworkId int

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    dryRun Boolean

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    enabled Boolean

    Specifies whether to enable traffic mirror sessions. default to false.

    packetLength Integer

    Maximum Transmission Unit (MTU).

    priority Integer

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    resourceGroupId String

    The ID of the resource group.

    status String

    The status of the resource.

    tags Map<String,Object>

    The tags of this resource.

    trafficMirrorFilterId String

    The ID of the filter.

    trafficMirrorSessionDescription String

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    trafficMirrorSessionName String

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    trafficMirrorSourceIds List<String>

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    trafficMirrorTargetId String

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    trafficMirrorTargetType String

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    virtualNetworkId Integer

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    dryRun boolean

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    enabled boolean

    Specifies whether to enable traffic mirror sessions. default to false.

    packetLength number

    Maximum Transmission Unit (MTU).

    priority number

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    resourceGroupId string

    The ID of the resource group.

    status string

    The status of the resource.

    tags {[key: string]: any}

    The tags of this resource.

    trafficMirrorFilterId string

    The ID of the filter.

    trafficMirrorSessionDescription string

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    trafficMirrorSessionName string

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    trafficMirrorSourceIds string[]

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    trafficMirrorTargetId string

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    trafficMirrorTargetType string

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    virtualNetworkId number

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    dry_run bool

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    enabled bool

    Specifies whether to enable traffic mirror sessions. default to false.

    packet_length int

    Maximum Transmission Unit (MTU).

    priority int

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    resource_group_id str

    The ID of the resource group.

    status str

    The status of the resource.

    tags Mapping[str, Any]

    The tags of this resource.

    traffic_mirror_filter_id str

    The ID of the filter.

    traffic_mirror_session_description str

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    traffic_mirror_session_name str

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    traffic_mirror_source_ids Sequence[str]

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    traffic_mirror_target_id str

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    traffic_mirror_target_type str

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    virtual_network_id int

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    dryRun Boolean

    Whether to PreCheck only this request, value:

    • true: sends a check request and does not create a mirror session. Check items include whether required parameters are filled in, request format, and restrictions. If the check fails, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
    • false (default): Sends a normal request and directly creates a mirror session after checking.
    enabled Boolean

    Specifies whether to enable traffic mirror sessions. default to false.

    packetLength Number

    Maximum Transmission Unit (MTU).

    priority Number

    The priority of the traffic mirror session. Valid values: 1 to 32766. A smaller value indicates a higher priority. You cannot specify the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

    resourceGroupId String

    The ID of the resource group.

    status String

    The status of the resource.

    tags Map<Any>

    The tags of this resource.

    trafficMirrorFilterId String

    The ID of the filter.

    trafficMirrorSessionDescription String

    The description of the traffic mirror session. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    trafficMirrorSessionName String

    The name of the traffic mirror session. The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

    trafficMirrorSourceIds List<String>

    The ID of the image source instance. Currently, the Eni is supported as the image source. The default value of N is 1, that is, only one mirror source can be added to a mirror session.

    trafficMirrorTargetId String

    The ID of the mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a mirror destination.

    trafficMirrorTargetType String

    The type of the mirror destination. Valid values: NetworkInterface or SLB. NetworkInterface: an ENI. SLB: an internal-facing SLB instance.

    virtualNetworkId Number

    The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. If you do not specify a VNI, the system randomly allocates a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

    Import

    VPC Traffic Mirror Session can be imported using the id, e.g.

     $ pulumi import alicloud:vpc/trafficMirrorSession:TrafficMirrorSession example <id>
    

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the alicloud Terraform Provider.

    alicloud logo
    Alibaba Cloud v3.45.1 published on Thursday, Dec 7, 2023 by Pulumi