alicloud.vpc.TrafficMirrorSession
Provides a VPC Traffic Mirror Session resource.
For information about VPC Traffic Mirror Session and how to use it, see What is Traffic Mirror Session.
NOTE: Available in 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 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 defaultNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
{
NameRegex = "default-NODELETING",
});
var defaultSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
{
VpcId = defaultNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
});
var vswitchId = defaultSwitches.Apply(getSwitchesResult => getSwitchesResult.Ids[0]);
var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new()
{
Description = "New security group",
VpcId = defaultNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
});
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 = "example_value",
HostName = "tf-testAcc",
ImageId = defaultImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
SecurityGroups = new[]
{
defaultSecurityGroup.Id,
},
VswitchId = vswitchId,
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 = "example_value",
VswitchId = vswitchId,
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.Select(__item => __item.Id).ToList()[range.Value],
NetworkInterfaceId = defaultEcsNetworkInterface.Select(__item => __item.Id).ToList()[range.Value],
}));
}
var defaultTrafficMirrorFilter = new AliCloud.Vpc.TrafficMirrorFilter("defaultTrafficMirrorFilter", new()
{
TrafficMirrorFilterName = "example_value",
TrafficMirrorFilterDescription = "example_value",
});
var defaultTrafficMirrorSession = new AliCloud.Vpc.TrafficMirrorSession("defaultTrafficMirrorSession", new()
{
Priority = 1,
VirtualNetworkId = 10,
TrafficMirrorSessionDescription = "example_value",
TrafficMirrorSessionName = "example_value",
TrafficMirrorTargetId = defaultEcsNetworkInterfaceAttachment[0].NetworkInterfaceId,
TrafficMirrorSourceIds = new[]
{
defaultEcsNetworkInterfaceAttachment[1].NetworkInterfaceId,
},
TrafficMirrorFilterId = defaultTrafficMirrorFilter.Id,
TrafficMirrorTargetType = "NetworkInterface",
});
});
Coming soon!
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.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
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 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());
final var defaultNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
.nameRegex("default-NODELETING")
.build());
final var defaultSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
.vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
final var vswitchId = defaultSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]);
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.description("New security group")
.vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
.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("example_value")
.hostName("tf-testAcc")
.imageId(defaultImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
.instanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
.securityGroups(defaultSecurityGroup.id())
.vswitchId(vswitchId)
.systemDiskCategory("cloud_essd")
.build());
}
for (var i = 0; i < 2; i++) {
new EcsNetworkInterface("defaultEcsNetworkInterface-" + i, EcsNetworkInterfaceArgs.builder()
.networkInterfaceName("example_value")
.vswitchId(vswitchId)
.securityGroupIds(defaultSecurityGroup.id())
.build());
}
for (var i = 0; i < 2; i++) {
new EcsNetworkInterfaceAttachment("defaultEcsNetworkInterfaceAttachment-" + i, EcsNetworkInterfaceAttachmentArgs.builder()
.instanceId(defaultInstance.stream().map(element -> element.id()).collect(toList())[range.value()])
.networkInterfaceId(defaultEcsNetworkInterface.stream().map(element -> element.id()).collect(toList())[range.value()])
.build());
}
var defaultTrafficMirrorFilter = new TrafficMirrorFilter("defaultTrafficMirrorFilter", TrafficMirrorFilterArgs.builder()
.trafficMirrorFilterName("example_value")
.trafficMirrorFilterDescription("example_value")
.build());
var defaultTrafficMirrorSession = new TrafficMirrorSession("defaultTrafficMirrorSession", TrafficMirrorSessionArgs.builder()
.priority(1)
.virtualNetworkId(10)
.trafficMirrorSessionDescription("example_value")
.trafficMirrorSessionName("example_value")
.trafficMirrorTargetId(defaultEcsNetworkInterfaceAttachment[0].networkInterfaceId())
.trafficMirrorSourceIds(defaultEcsNetworkInterfaceAttachment[1].networkInterfaceId())
.trafficMirrorFilterId(defaultTrafficMirrorFilter.id())
.trafficMirrorTargetType("NetworkInterface")
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
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_networks = alicloud.vpc.get_networks(name_regex="default-NODELETING")
default_switches = alicloud.vpc.get_switches(vpc_id=default_networks.ids[0],
zone_id=default_zones.zones[0].id)
vswitch_id = default_switches.ids[0]
default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup",
description="New security group",
vpc_id=default_networks.ids[0])
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="example_value",
host_name="tf-testAcc",
image_id=default_images.images[0].id,
instance_type=default_instance_types.instance_types[0].id,
security_groups=[default_security_group.id],
vswitch_id=vswitch_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="example_value",
vswitch_id=vswitch_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=[__item.id for __item in default_instance][range["value"]],
network_interface_id=[__item.id for __item in default_ecs_network_interface][range["value"]]))
default_traffic_mirror_filter = alicloud.vpc.TrafficMirrorFilter("defaultTrafficMirrorFilter",
traffic_mirror_filter_name="example_value",
traffic_mirror_filter_description="example_value")
default_traffic_mirror_session = alicloud.vpc.TrafficMirrorSession("defaultTrafficMirrorSession",
priority=1,
virtual_network_id=10,
traffic_mirror_session_description="example_value",
traffic_mirror_session_name="example_value",
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 defaultInstanceTypes = alicloud.ecs.getInstanceTypes({
instanceTypeFamily: "ecs.g7",
});
const defaultZones = defaultInstanceTypes.then(defaultInstanceTypes => alicloud.getZones({
availableResourceCreation: "Instance",
availableInstanceType: defaultInstanceTypes.instanceTypes?.[0]?.id,
}));
const defaultNetworks = alicloud.vpc.getNetworks({
nameRegex: "default-NODELETING",
});
const defaultSwitches = Promise.all([defaultNetworks, defaultZones]).then(([defaultNetworks, defaultZones]) => alicloud.vpc.getSwitches({
vpcId: defaultNetworks.ids?.[0],
zoneId: defaultZones.zones?.[0]?.id,
}));
const vswitchId = defaultSwitches.then(defaultSwitches => defaultSwitches.ids?.[0]);
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("defaultSecurityGroup", {
description: "New security group",
vpcId: defaultNetworks.then(defaultNetworks => defaultNetworks.ids?.[0]),
});
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: "example_value",
hostName: "tf-testAcc",
imageId: defaultImages.then(defaultImages => defaultImages.images?.[0]?.id),
instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.instanceTypes?.[0]?.id),
securityGroups: [defaultSecurityGroup.id],
vswitchId: vswitchId,
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: "example_value",
vswitchId: vswitchId,
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.map(__item => __item.id)[range.value],
networkInterfaceId: defaultEcsNetworkInterface.map(__item => __item.id)[range.value],
}));
}
const defaultTrafficMirrorFilter = new alicloud.vpc.TrafficMirrorFilter("defaultTrafficMirrorFilter", {
trafficMirrorFilterName: "example_value",
trafficMirrorFilterDescription: "example_value",
});
const defaultTrafficMirrorSession = new alicloud.vpc.TrafficMirrorSession("defaultTrafficMirrorSession", {
priority: 1,
virtualNetworkId: 10,
trafficMirrorSessionDescription: "example_value",
trafficMirrorSessionName: "example_value",
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,
priority: Optional[int] = 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
to32766
. 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 stringFilter Id The ID of the filter.
- Traffic
Mirror List<string>Source Ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- Traffic
Mirror stringTarget Id 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 stringTarget Type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- Dry
Run bool The dry run.
- Enabled bool
Specifies whether to enable traffic mirror sessions. default to
false
.- Traffic
Mirror stringSession Description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- Traffic
Mirror stringSession Name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- Virtual
Network intId The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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
to32766
. 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 stringFilter Id The ID of the filter.
- Traffic
Mirror []stringSource Ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- Traffic
Mirror stringTarget Id 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 stringTarget Type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- Dry
Run bool The dry run.
- Enabled bool
Specifies whether to enable traffic mirror sessions. default to
false
.- Traffic
Mirror stringSession Description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- Traffic
Mirror stringSession Name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- Virtual
Network intId The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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
to32766
. 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 StringFilter Id The ID of the filter.
- traffic
Mirror List<String>Source Ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- traffic
Mirror StringTarget Id 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 StringTarget Type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- dry
Run Boolean The dry run.
- enabled Boolean
Specifies whether to enable traffic mirror sessions. default to
false
.- traffic
Mirror StringSession Description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- traffic
Mirror StringSession Name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- virtual
Network IntegerId The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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
to32766
. 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 stringFilter Id The ID of the filter.
- traffic
Mirror string[]Source Ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- traffic
Mirror stringTarget Id 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 stringTarget Type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- dry
Run boolean The dry run.
- enabled boolean
Specifies whether to enable traffic mirror sessions. default to
false
.- traffic
Mirror stringSession Description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- traffic
Mirror stringSession Name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- virtual
Network numberId The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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
to32766
. 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_ strfilter_ id The ID of the filter.
- traffic_
mirror_ Sequence[str]source_ ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- traffic_
mirror_ strtarget_ id 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_ strtarget_ type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- dry_
run bool The dry run.
- enabled bool
Specifies whether to enable traffic mirror sessions. default to
false
.- traffic_
mirror_ strsession_ description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- traffic_
mirror_ strsession_ name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- virtual_
network_ intid The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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
to32766
. 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 StringFilter Id The ID of the filter.
- traffic
Mirror List<String>Source Ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- traffic
Mirror StringTarget Id 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 StringTarget Type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- dry
Run Boolean The dry run.
- enabled Boolean
Specifies whether to enable traffic mirror sessions. default to
false
.- traffic
Mirror StringSession Description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- traffic
Mirror StringSession Name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- virtual
Network NumberId The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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:
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,
priority: Optional[int] = None,
status: Optional[str] = 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.
- Dry
Run bool The dry run.
- Enabled bool
Specifies whether to enable traffic mirror sessions. default to
false
.- Priority int
The priority of the traffic mirror session. Valid values:
1
to32766
. 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.- Status string
The state of the traffic mirror session. Valid values:
Creating
,Created
,Modifying
andDeleting
.- Traffic
Mirror stringFilter Id The ID of the filter.
- Traffic
Mirror stringSession Description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- Traffic
Mirror stringSession Name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- Traffic
Mirror List<string>Source Ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- Traffic
Mirror stringTarget Id 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 stringTarget Type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- Virtual
Network intId The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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 The dry run.
- Enabled bool
Specifies whether to enable traffic mirror sessions. default to
false
.- Priority int
The priority of the traffic mirror session. Valid values:
1
to32766
. 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.- Status string
The state of the traffic mirror session. Valid values:
Creating
,Created
,Modifying
andDeleting
.- Traffic
Mirror stringFilter Id The ID of the filter.
- Traffic
Mirror stringSession Description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- Traffic
Mirror stringSession Name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- Traffic
Mirror []stringSource Ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- Traffic
Mirror stringTarget Id 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 stringTarget Type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- Virtual
Network intId The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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 Boolean The dry run.
- enabled Boolean
Specifies whether to enable traffic mirror sessions. default to
false
.- priority Integer
The priority of the traffic mirror session. Valid values:
1
to32766
. 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.- status String
The state of the traffic mirror session. Valid values:
Creating
,Created
,Modifying
andDeleting
.- traffic
Mirror StringFilter Id The ID of the filter.
- traffic
Mirror StringSession Description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- traffic
Mirror StringSession Name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- traffic
Mirror List<String>Source Ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- traffic
Mirror StringTarget Id 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 StringTarget Type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- virtual
Network IntegerId The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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 boolean The dry run.
- enabled boolean
Specifies whether to enable traffic mirror sessions. default to
false
.- priority number
The priority of the traffic mirror session. Valid values:
1
to32766
. 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.- status string
The state of the traffic mirror session. Valid values:
Creating
,Created
,Modifying
andDeleting
.- traffic
Mirror stringFilter Id The ID of the filter.
- traffic
Mirror stringSession Description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- traffic
Mirror stringSession Name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- traffic
Mirror string[]Source Ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- traffic
Mirror stringTarget Id 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 stringTarget Type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- virtual
Network numberId The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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 The dry run.
- enabled bool
Specifies whether to enable traffic mirror sessions. default to
false
.- priority int
The priority of the traffic mirror session. Valid values:
1
to32766
. 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.- status str
The state of the traffic mirror session. Valid values:
Creating
,Created
,Modifying
andDeleting
.- traffic_
mirror_ strfilter_ id The ID of the filter.
- traffic_
mirror_ strsession_ description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- traffic_
mirror_ strsession_ name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- traffic_
mirror_ Sequence[str]source_ ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- traffic_
mirror_ strtarget_ id 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_ strtarget_ type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- virtual_
network_ intid The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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 Boolean The dry run.
- enabled Boolean
Specifies whether to enable traffic mirror sessions. default to
false
.- priority Number
The priority of the traffic mirror session. Valid values:
1
to32766
. 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.- status String
The state of the traffic mirror session. Valid values:
Creating
,Created
,Modifying
andDeleting
.- traffic
Mirror StringFilter Id The ID of the filter.
- traffic
Mirror StringSession Description The description of the traffic mirror session. The description must be
2
to256
characters in length and cannot start withhttp://
orhttps://
.- traffic
Mirror StringSession Name The name of the traffic mirror session. The name must be
2
to128
characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.- traffic
Mirror List<String>Source Ids The ID of the mirror source. You can specify only an elastic network interface (ENI) as the mirror source. NOTE: Only one mirror source can be added to a traffic mirror session.
- traffic
Mirror StringTarget Id 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 StringTarget Type The type of the mirror destination. Valid values:
NetworkInterface
orSLB
.NetworkInterface
: an ENI.SLB
: an internal-facing SLB instance- virtual
Network NumberId The VXLAN network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values:
0
to16777215
. 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.