All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::VPC::TrafficMirrorSession

Last Updated:Nov 23, 2023

ALIYUN::VPC::TrafficMirrorSession is used to create a traffic image session.

Syntax

{
  "Type": "ALIYUN::VPC::TrafficMirrorSession",
  "Properties": {
    "TrafficMirrorTargetId": String,
    "ResourceGroupId": String,
    "VirtualNetworkId": Integer,
    "TrafficMirrorSourceIds": List,
    "Priority": Integer,
    "PacketLength": Integer,
    "Enabled": Boolean,
    "TrafficMirrorSessionDescription": String,
    "Tag": List,
    "TrafficMirrorSessionName": String,
    "TrafficMirrorFilterId": String,
    "TrafficMirrorTargetType": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

TrafficMirrorTargetId

String

Yes

Yes

The ID of the traffic mirror destination.

You can specify only an elastic network interface (ENI) or a Server Load Balancer (SLB) instance as a traffic mirror destination.

ResourceGroupId

String

No

No

The ID of the resource group to which the traffic image session belongs.

None.

VirtualNetworkId

Integer

No

Yes

The VXLAN network identifier (VNI) that you want to use to distinguish different mirrored traffic.

Valid values: 0 to 16777215.

You can use VNIs to identify mirrored traffic from different sessions at the traffic mirror destination. You can specify a custom VNI or use a random VNI that is allocated by the system. If you want to use a random VNI, leave this property empty.

TrafficMirrorSourceIds

List

Yes

No

The ID of the traffic mirror source.

You can specify only an ENI as the traffic mirror source. You can add only one traffic mirror source to a traffic mirror session.

Priority

Integer

Yes

Yes

The priority of the traffic mirror session.

Valid values: 1 to 32766. A smaller value indicates a higher priority. The priorities of traffic mirror sessions in the same region within the same account must be unique.

PacketLength

Integer

No

Yes

The maximum transmission unit (MTU).

Default value: 1500.

Enabled

Boolean

No

Yes

Specifies whether to enable the traffic mirror session.

Valid values:

  • false (default)

  • true

TrafficMirrorSessionDescription

String

No

Yes

The description of the traffic mirror session.

The description must be 1 to 256 characters in length, and cannot start with http:// or https://.

Tag

List

No

No

The tags of the traffic mirror session.

You can add up to 20 tags.

For more information, see Tag properties.

TrafficMirrorSessionName

String

No

Yes

The name of the traffic mirror session.

The name must be 1 to 128 characters in length, and cannot start with http:// or https://.

TrafficMirrorFilterId

String

Yes

Yes

The ID of the filter that you want to use to control network traffic in the traffic mirror session.

None.

TrafficMirrorTargetType

String

Yes

Yes

The type of the traffic mirror destination.

Valid values:

  • NetworkInterface: ENI

  • SLB: SLB instance

Tag syntax

"Tag": [
  {
    "Value": String,
    "Key": String
  }
]

Tag properties

Property

Type

Required

Editable

Description

Constraint

Value

String

No

No

The value of the tag.

None.

Key

String

No

No

The key of the tag.

The tag key can be up to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Return values

Fn::GetAtt

TrafficMirrorSessionId: the ID of the traffic mirror session.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      Priority:
        Description: 'The priority of the traffic mirror session. Valid values: **1 to 32766**.
            A smaller value indicates a higher priority. You cannot specify identical
            priorities for traffic mirror sessions that are created in the same region
            by using the same account.'
        MaxValue: 32766
        MinValue: 1
        Type: Number
        Default: 1
      TrafficMirrorFilterId:
        Description: The ID of the filter.
        Type: String
        Default: tmf-j6cmls82xnc86vtpe****
      TrafficMirrorSourceIds:
        AssociationProperty: List[Parameter]
        AssociationPropertyMetadata:
          Parameter:
            Description: The ID of the traffic mirror source. You can specify only an ENI as
                the traffic mirror source. The default value of N is 1, which means that
                you can add only one traffic mirror source to a traffic mirror session.
            Type: String
        Type: Json
        Default: [eni-j6c2fp57q8rr47rp****]
      TrafficMirrorTargetId:
        Description: The ID of the traffic mirror destination. You can specify only an elastic
            network interface (ENI) or a Server Load Balancer (SLB) instance as a traffic
            mirror destination.
        Type: String
        Default: eni-j6c8znm5l1yt4sox****
      TrafficMirrorTargetType:
        Description: 'The type of the traffic mirror destination. Valid values:
            - **NetworkInterface**: an ENI
            - **SLB**: an SLB instance'
        Type: String
        Default: NetworkInterface
    Resources:
      TrafficMirrorSession:
        Properties:
          Priority:
            Ref: Priority
          TrafficMirrorFilterId:
            Ref: TrafficMirrorFilterId
          TrafficMirrorSourceIds:
            Ref: TrafficMirrorSourceIds
          TrafficMirrorTargetId:
            Ref: TrafficMirrorTargetId
          TrafficMirrorTargetType:
            Ref: TrafficMirrorTargetType
        Type: ALIYUN::VPC::TrafficMirrorSession
    Outputs:
      TrafficMirrorSessionId:
        Description: The ID of the traffic mirror session.
        Value:
          Fn::GetAtt:
          - TrafficMirrorSession
          - TrafficMirrorSessionId
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "Priority": {
          "Description": "The priority of the traffic mirror session. Valid values: **1 to 32766**.\nA smaller value indicates a higher priority. You cannot specify identical priorities for traffic mirror sessions that are created in the same region by using the same account.",
          "MaxValue": 32766,
          "MinValue": 1,
          "Type": "Number",
          "Default": 1
        },
        "TrafficMirrorFilterId": {
          "Description": "The ID of the filter.",
          "Type": "String",
          "Default": "tmf-j6cmls82xnc86vtpe****"
        },
        "TrafficMirrorSourceIds": {
          "AssociationProperty": "List[Parameter]",
          "AssociationPropertyMetadata": {
            "Parameter": {
              "Description": "The ID of the traffic mirror source. You can specify only an ENI as the traffic mirror source. The default value of N is 1, which means that you can add only one traffic mirror source to a traffic mirror session.",
              "Type": "String"
            }
          },
          "Type": "Json",
          "Default": [
            "eni-j6c2fp57q8rr47rp****"
          ]
        },
        "TrafficMirrorTargetId": {
          "Description": "The ID of the traffic mirror destination. You can specify only an elastic network interface (ENI) or a Server Load Balancer (SLB) instance as a traffic mirror destination.",
          "Type": "String",
          "Default": "eni-j6c8znm5l1yt4sox****"
        },
        "TrafficMirrorTargetType": {
          "Description": "The type of the traffic mirror destination. Valid values: - **NetworkInterface**: an ENI - **SLB**: an SLB instance",
          "Type": "String",
          "Default": "NetworkInterface"
        }
      },
      "Resources": {
        "TrafficMirrorSession": {
          "Properties": {
            "Priority": {
              "Ref": "Priority"
            },
            "TrafficMirrorFilterId": {
              "Ref": "TrafficMirrorFilterId"
            },
            "TrafficMirrorSourceIds": {
              "Ref": "TrafficMirrorSourceIds"
            },
            "TrafficMirrorTargetId": {
              "Ref": "TrafficMirrorTargetId"
            },
            "TrafficMirrorTargetType": {
              "Ref": "TrafficMirrorTargetType"
            }
          },
          "Type": "ALIYUN::VPC::TrafficMirrorSession"
        }
      },
      "Outputs": {
        "TrafficMirrorSessionId": {
          "Description": "The ID of the traffic mirror session.",
          "Value": {
            "Fn::GetAtt": [
              "TrafficMirrorSession",
              "TrafficMirrorSessionId"
            ]
          }
        }
      }
    }