Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::VPC::TrafficQosRule

Última atualização: Aug 27, 2026

O recurso ALIYUN::VPC::TrafficQosRule cria uma regra de Quality of Service (QoS) para classificar e priorizar o tráfego de rede.

Sintaxe

{
  "Type": "ALIYUN::VPC::TrafficQosRule",
  "Properties": {
    "Priority": Integer,
    "Protocol": String,
    "QueueId": String,
    "QosId": String,
    "DstIpv6Cidr": String,
    "DstPortRange": String,
    "DstCidr": String,
    "MatchDscp": Integer,
    "RuleDescription": String,
    "RemarkingDscp": Integer,
    "RuleName": String,
    "SrcIpv6Cidr": String,
    "SrcCidr": String,
    "SrcPortRange": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

Priority

Integer

Sim

Sim

Prioridade da regra de QoS.

Valores válidos: 1 a 9000. Valores maiores indicam prioridades mais altas. A prioridade de cada regra de QoS deve ser exclusiva na política de QoS.

Protocol

String

Sim

Sim

Tipo de protocolo da regra de QoS.

Valores válidos:

  • ALL

  • ICMP(IPv4)

  • ICMPv6(IPv6)

  • TCP

  • UDP

  • GRE

  • SSH

  • Telnet

  • HTTP

  • HTTPS

  • MS SQL

  • Oracle

  • MySql

  • RDP

  • PostgreSQL

  • Redis

QosId

String

Sim

Não

ID da política de QoS.

Nenhuma

QueueId

String

Sim

Não

ID da fila de QoS.

Nenhuma

DstCidr

String

Não

Sim

Bloco CIDR IPv4 de destino a ser correspondido.

Nenhuma

DstIpv6Cidr

String

Não

Sim

Bloco CIDR IPv6 de destino a ser correspondido.

Nenhuma

DstPortRange

String

Não

Sim

Intervalo de portas de destino a ser correspondido.

Valores válidos: 0 a 65535. Para corresponder a qualquer porta, defina o valor como -1/-1. Há suporte apenas para uma única porta. Os números das portas inicial e final devem ser iguais. O intervalo de portas de destino é fixo para os seguintes tipos de protocolo:

  • ALL: -1/-1, não editável.

  • ICMP(IPv4): -1/-1, não editável.

  • ICMPv6(IPv6): -1/-1, não editável.

  • TCP: -1/-1, editável.

  • UDP: -1/-1, editável.

  • GRE: -1/-1, não editável.

  • SSH: 22/22, não editável.

  • Telnet: 23/23, não editável.

  • HTTP: 80/80, não editável.

  • HTTPS: 443/443, não editável.

  • MS SQL: 1433/1433, não editável.

  • Oracle: 1521/1521, não editável.

  • MySql: 3306/3306, não editável.

  • RDP: 3389/3389, não editável.

  • PostgreSQL: 5432/5432, não editável.

  • Redis: 6379/6379, não editável.

MatchDscp

Integer

Não

Sim

Valor do Differentiated Services Code Point (DSCP) a ser correspondido.

Valores válidos: 0 a 63. Para desativar a correspondência DSCP, defina este valor como -1.

RemarkingDscp

Integer

Não

Sim

Novo valor DSCP a ser aplicado ao tráfego correspondente.

Valores válidos: 0 a 63. Para manter o valor DSCP original inalterado, defina este valor como -1.

RuleDescription

String

Não

Sim

Descrição da regra de QoS.

A descrição deve ter de 0 a 256 caracteres e não pode começar com http:// ou https://.

RuleName

String

Não

Sim

Nome da regra de QoS.

O nome deve ter de 0 a 128 caracteres e não pode começar com http:// ou https://.

SrcCidr

String

Não

Sim

Bloco CIDR IPv4 de origem a ser correspondido.

Nenhuma

SrcIpv6Cidr

String

Não

Sim

Bloco CIDR IPv6 de origem a ser correspondido.

Nenhuma

SrcPortRange

String

Não

Sim

Intervalo de portas de origem a ser correspondido.

Valores válidos: 0 a 65535. Para corresponder a qualquer porta, defina o valor como -1/-1. Há suporte apenas para uma única porta. Os números das portas inicial e final devem ser iguais.

Valores de retorno

Fn::GetAtt

  • RuleDescription: descrição da regra de QoS.

  • DstIpv6Cidr: bloco CIDR IPv6 de destino correspondente.

  • MatchDscp: valor DSCP correspondente. Valores válidos: 0 a 63. O valor -1 indica que nenhum valor DSCP foi correspondido.

  • Priority: prioridade da regra de QoS. Valores válidos: 1 a 9000. Valores maiores indicam prioridades mais altas. A prioridade de cada regra de QoS deve ser exclusiva na política de QoS.

  • RuleId: ID da regra de QoS.

  • QueueId: ID da fila de QoS.

  • SrcIpv6Cidr: bloco CIDR IPv6 de origem correspondente.

  • DstPortRange: intervalo de portas de destino correspondente. Valores válidos: 0 a 65535. O valor -1/-1 indica que nenhuma porta foi correspondida. Há suporte apenas para portas únicas, em que os números das portas inicial e final devem ser iguais. O intervalo de portas de destino é fixo para alguns tipos de protocolo.

  • RemarkingDscp: novo valor DSCP aplicado ao tráfego. Valores válidos: 0 a 63. O valor -1 indica que o valor DSCP original foi mantido.

  • SrcCidr: bloco CIDR IPv4 de origem correspondente.

  • QosId: ID da política de QoS.

  • Protocol: tipo de protocolo da regra de QoS.

  • SrcPortRange: intervalo de portas de origem correspondente. Valores válidos: 0 a 65535. O valor -1/-1 indica que nenhuma porta foi correspondida. Há suporte apenas para portas únicas, em que os números das portas inicial e final devem ser iguais.

  • DstCidr: bloco CIDR IPv4 de destino correspondente.

  • RuleName: nome da regra de QoS.

Exemplo

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DstCidr:
    Type: String
    Description:
      en: |-
        The destination IPv4 CIDR block to match.
        > You must specify at least one of `SrcCidr`, `DstCidr`, `SrcIpv6Cidr`, or `DstIpv6Cidr`.
    Default: Null
    Required: false
  QueueId:
    Type: String
    Description:
      en: The ID of the QoS queue.
    Required: true
  Protocol:
    Type: String
    Description:
      en: |-
        The protocol type of the QoS rule. Valid values:
        - **ALL**
        - **ICMP(IPv4)**
        - **ICMPv6(IPv6)**
        - **TCP**
        - **UDP**
        - **GRE**
        - **SSH**
        - **Telnet**
        - **HTTP**
        - **HTTPS**
        - **MS SQL**
        - **Oracle**
        - **MySql**
        - **RDP**
        - **PostgreSQL**
        - **Redis**
    AllowedValues:
      - ALL
      - ICMP(IPv4)
      - ICMPv6(IPv6)
      - TCP
      - UDP
      - GRE
      - SSH
      - Telnet
      - HTTP
      - HTTPS
      - MS SQL
      - Oracle
      - MySql
      - RDP
      - PostgreSQL
      - Redis
    Required: true
  SrcCidr:
    Type: String
    Description:
      en: |-
        The source IPv4 CIDR block to match.
        > You must specify at least one of `SrcCidr`, `DstCidr`, `SrcIpv6Cidr`, or `DstIpv6Cidr`.
    Default: Null
    Required: false
  MatchDscp:
    Type: Number
    Description:
      en: 'The DSCP value to match. Valid values: 0 to 63. Set to -1 to disable DSCP matching.'
    MinValue: 0
    MaxValue: 63
    Default: Null
    Required: false
  DstPortRange:
    Type: String
    Description:
      en: |-
        The destination port range to match. Valid values: 0 to 65535. Set to -1/-1 to match any port. Only single ports are supported; the start and end port numbers must be the same. The destination port range is fixed for the following protocol types:
        - **ALL**: -1/-1, non-editable.
        - **ICMP(IPv4)**: -1/-1, non-editable.
        - **ICMPv6(IPv6)**: -1/-1, non-editable.
        - **TCP**: -1/-1, editable.
        - **UDP**: -1/-1, editable.
        - **GRE**: -1/-1, non-editable.
        - **SSH**: 22/22, non-editable.
        - **Telnet**: 23/23, non-editable.
        - **HTTP**: 80/80, non-editable.
        - **HTTPS**: 443/443, non-editable.
        - **MS SQL**: 1433/1433, non-editable.
        - **Oracle**: 1521/1521, non-editable.
        - **MySql**: 3306/3306, non-editable.
        - **RDP**: 3389/3389, non-editable.
        - **PostgreSQL**: 5432/5432, non-editable.
        - **Redis**: 6379/6379, non-editable.
    Default: Null
    Required: false
  Priority:
    Type: Number
    Description:
      en: 'The priority of the QoS rule. Valid values: 1 to 9000. A larger value indicates a higher priority. The priority of each QoS rule must be unique within the same QoS policy.'
    MinValue: 1
    MaxValue: 9000
    Required: true
  SrcIpv6Cidr:
    Type: String
    Description:
      en: |-
        The source IPv6 CIDR block to match.
        > You must specify at least one of `SrcCidr`, `DstCidr`, `SrcIpv6Cidr`, or `DstIpv6Cidr`.
    Default: Null
    Required: false
  DstIpv6Cidr:
    Type: String
    Description:
      en: |-
        The destination IPv6 CIDR block to match.
        > You must specify at least one of `SrcCidr`, `DstCidr`, `SrcIpv6Cidr`, or `DstIpv6Cidr`.
    Default: Null
    Required: false
  QosId:
    Type: String
    Description:
      en: The ID of the QoS policy.
    Required: true
  SrcPortRange:
    Type: String
    Description:
      en: 'The source port range to match. Valid values: 0 to 65535. Set to -1/-1 to match any port. Only single ports are supported; the start and end port numbers must be the same.'
    Default: Null
    Required: false
  RuleName:
    Type: String
    Description:
      en: |-
        The name of the QoS rule.
        The name must be 0 to 128 characters in length and cannot start with 'http://' or 'https://'.
    MinLength: 0
    MaxLength: 128
    Default: Null
    Required: false
  RemarkingDscp:
    Type: Number
    Description:
      en: 'The new DSCP value to apply to matched traffic. Valid values: 0 to 63. To leave the original DSCP value unchanged, set this to -1.'
    MinValue: 0
    MaxValue: 63
    Default: Null
    Required: false
  RuleDescription:
    Type: String
    Description:
      en: |-
        The description of the QoS rule.
        The description must be 0 to 256 characters in length and cannot start with 'http://' or 'https://'.
    MinLength: 0
    MaxLength: 256
    Default: Null
    Required: false
Resources:
  ExtensionResource:
    Type: ALIYUN::VPC::TrafficQosRule
    Properties:
      DstCidr:
        Ref: DstCidr
      QueueId:
        Ref: QueueId
      Protocol:
        Ref: Protocol
      SrcCidr:
        Ref: SrcCidr
      MatchDscp:
        Ref: MatchDscp
      DstPortRange:
        Ref: DstPortRange
      Priority:
        Ref: Priority
      SrcIpv6Cidr:
        Ref: SrcIpv6Cidr
      DstIpv6Cidr:
        Ref: DstIpv6Cidr
      QosId:
        Ref: QosId
      SrcPortRange:
        Ref: SrcPortRange
      RuleName:
        Ref: RuleName
      RemarkingDscp:
        Ref: RemarkingDscp
      RuleDescription:
        Ref: RuleDescription
Outputs:
  DstCidr:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - DstCidr
    Description: The matched destination IPv4 CIDR block.
  QueueId:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - QueueId
    Description: The ID of the QoS queue.
  Protocol:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Protocol
    Description: The protocol type of the QoS rule.
  RuleId:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleId
    Description: The ID of the QoS rule.
  SrcCidr:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SrcCidr
    Description: The matched source IPv4 CIDR block.
  MatchDscp:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - MatchDscp
    Description: 'The matched DSCP value. Valid values: 0 to 63. A value of -1 means no DSCP value is matched.'
  DstPortRange:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - DstPortRange
    Description: 'The matched destination port range. Valid values: 0 to 65535. A value of -1/-1 means no port is matched. Only single ports are supported, where the start and end port numbers must be the same. The destination port range is fixed for some protocol types.'
  Priority:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Priority
    Description: 'The priority of the QoS rule. Valid values: 1 to 9000. A larger value indicates a higher priority. The priority of each QoS rule must be unique within a QoS policy.'
  SrcIpv6Cidr:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SrcIpv6Cidr
    Description: The matched source IPv6 CIDR block.
  DstIpv6Cidr:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - DstIpv6Cidr
    Description: The matched destination IPv6 CIDR block.
  QosId:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - QosId
    Description: The ID of the QoS policy.
  SrcPortRange:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SrcPortRange
    Description: 'The matched source port range. Valid values: 0 to 65535. A value of -1/-1 means no port is matched. Only single ports are supported, where the start and end port numbers must be the same.'
  RuleName:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleName
    Description: The name of the QoS rule.
  RemarkingDscp:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RemarkingDscp
    Description: 'The new DSCP value applied to the traffic. Valid values: 0 to 63. A value of -1 means the original DSCP value is retained.'
  RuleDescription:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleDescription
    Description: The description of the QoS rule.
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DstCidr": {
      "Type": "String",
      "Description": {
        "en": "The destination IPv4 CIDR block to match.\n> You must specify at least one of `SrcCidr`, `DstCidr`, `SrcIpv6Cidr`, or `DstIpv6Cidr`."
      },
      "Default": null,
      "Required": false
    },
    "QueueId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the QoS queue."
      },
      "Required": true
    },
    "Protocol": {
      "Type": "String",
      "Description": {
        "en": "The protocol type of the QoS rule. Valid values:\n- **ALL**\n- **ICMP(IPv4)**\n- **ICMPv6(IPv6)**\n- **TCP**\n- **UDP**\n- **GRE**\n- **SSH**\n- **Telnet**\n- **HTTP**\n- **HTTPS**\n- **MS SQL**\n- **Oracle**\n- **MySql**\n- **RDP**\n- **PostgreSQL**\n- **Redis**"
      },
      "AllowedValues": [
        "ALL",
        "ICMP(IPv4)",
        "ICMPv6(IPv6)",
        "TCP",
        "UDP",
        "GRE",
        "SSH",
        "Telnet",
        "HTTP",
        "HTTPS",
        "MS SQL",
        "Oracle",
        "MySql",
        "RDP",
        "PostgreSQL",
        "Redis"
      ],
      "Required": true
    },
    "SrcCidr": {
      "Type": "String",
      "Description": {
        "en": "The source IPv4 CIDR block to match.\n> You must specify at least one of `SrcCidr`, `DstCidr`, `SrcIpv6Cidr`, or `DstIpv6Cidr`."
      },
      "Default": null,
      "Required": false
    },
    "MatchDscp": {
      "Type": "Number",
      "Description": {
        "en": "The DSCP value to match. Valid values: 0 to 63. Set to -1 to disable DSCP matching."
      },
      "MinValue": 0,
      "MaxValue": 63,
      "Default": null,
      "Required": false
    },
    "DstPortRange": {
      "Type": "String",
      "Description": {
        "en": "The destination port range to match. Valid values: 0 to 65535. Set to -1/-1 to match any port. Only single ports are supported; the start and end port numbers must be the same. The destination port range is fixed for the following protocol types:\n- **ALL**: -1/-1, non-editable.\n- **ICMP(IPv4)**: -1/-1, non-editable.\n- **ICMPv6(IPv6)**: -1/-1, non-editable.\n- **TCP**: -1/-1, editable.\n- **UDP**: -1/-1, editable.\n- **GRE**: -1/-1, non-editable.\n- **SSH**: 22/22, non-editable.\n- **Telnet**: 23/23, non-editable.\n- **HTTP**: 80/80, non-editable.\n- **HTTPS**: 443/443, non-editable.\n- **MS SQL**: 1433/1433, non-editable.\n- **Oracle**: 1521/1521, non-editable.\n- **MySql**: 3306/3306, non-editable.\n- **RDP**: 3389/3389, non-editable.\n- **PostgreSQL**: 5432/5432, non-editable.\n- **Redis**: 6379/6379, non-editable."
      },
      "Default": null,
      "Required": false
    },
    "Priority": {
      "Type": "Number",
      "Description": {
        "en": "The priority of the QoS rule. Valid values: 1 to 9000. A larger value indicates a higher priority. The priority of each QoS rule must be unique within the same QoS policy."
      },
      "MinValue": 1,
      "MaxValue": 9000,
      "Required": true
    },
    "SrcIpv6Cidr": {
      "Type": "String",
      "Description": {
        "en": "The source IPv6 CIDR block to match.\n> You must specify at least one of `SrcCidr`, `DstCidr`, `SrcIpv6Cidr`, or `DstIpv6Cidr`."
      },
      "Default": null,
      "Required": false
    },
    "DstIpv6Cidr": {
      "Type": "String",
      "Description": {
        "en": "The destination IPv6 CIDR block to match.\n> You must specify at least one of `SrcCidr`, `DstCidr`, `SrcIpv6Cidr`, or `DstIpv6Cidr`."
      },
      "Default": null,
      "Required": false
    },
    "QosId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the QoS policy."
      },
      "Required": true
    },
    "SrcPortRange": {
      "Type": "String",
      "Description": {
        "en": "The source port range to match. Valid values: 0 to 65535. Set to -1/-1 to match any port. Only single ports are supported; the start and end port numbers must be the same."
      },
      "Default": null,
      "Required": false
    },
    "RuleName": {
      "Type": "String",
      "Description": {
        "en": "The name of the QoS rule.\nThe name must be 0 to 128 characters in length and cannot start with 'http://' or 'https://'."
      },
      "MinLength": 0,
      "MaxLength": 128,
      "Default": null,
      "Required": false
    },
    "RemarkingDscp": {
      "Type": "Number",
      "Description": {
        "en": "The new DSCP value to apply to matched traffic. Valid values: 0 to 63. To leave the original DSCP value unchanged, set this to -1."
      },
      "MinValue": 0,
      "MaxValue": 63,
      "Default": null,
      "Required": false
    },
    "RuleDescription": {
      "Type": "String",
      "Description": {
        "en": "The description of the QoS rule.\nThe description must be 0 to 256 characters in length and cannot start with 'http://' or 'https://'."
      },
      "MinLength": 0,
      "MaxLength": 256,
      "Default": null,
      "Required": false
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::VPC::TrafficQosRule",
      "Properties": {
        "DstCidr": {
          "Ref": "DstCidr"
        },
        "QueueId": {
          "Ref": "QueueId"
        },
        "Protocol": {
          "Ref": "Protocol"
        },
        "SrcCidr": {
          "Ref": "SrcCidr"
        },
        "MatchDscp": {
          "Ref": "MatchDscp"
        },
        "DstPortRange": {
          "Ref": "DstPortRange"
        },
        "Priority": {
          "Ref": "Priority"
        },
        "SrcIpv6Cidr": {
          "Ref": "SrcIpv6Cidr"
        },
        "DstIpv6Cidr": {
          "Ref": "DstIpv6Cidr"
        },
        "QosId": {
          "Ref": "QosId"
        },
        "SrcPortRange": {
          "Ref": "SrcPortRange"
        },
        "RuleName": {
          "Ref": "RuleName"
        },
        "RemarkingDscp": {
          "Ref": "RemarkingDscp"
        },
        "RuleDescription": {
          "Ref": "RuleDescription"
        }
      }
    }
  },
  "Outputs": {
    "DstCidr": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "DstCidr"
        ]
      },
      "Description": "The matched destination IPv4 CIDR block."
    },
    "QueueId": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "QueueId"
        ]
      },
      "Description": "The ID of the QoS queue."
    },
    "Protocol": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Protocol"
        ]
      },
      "Description": "The protocol type of the QoS rule."
    },
    "RuleId": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleId"
        ]
      },
      "Description": "The ID of the QoS rule."
    },
    "SrcCidr": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SrcCidr"
        ]
      },
      "Description": "The matched source IPv4 CIDR block."
    },
    "MatchDscp": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "MatchDscp"
        ]
      },
      "Description": "The matched DSCP value. Valid values: 0 to 63. A value of -1 means no DSCP value is matched."
    },
    "DstPortRange": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "DstPortRange"
        ]
      },
      "Description": "The matched destination port range. Valid values: 0 to 65535. A value of -1/-1 means no port is matched. Only single ports are supported, where the start and end port numbers must be the same. The destination port range is fixed for some protocol types."
    },
    "Priority": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Priority"
        ]
      },
      "Description": "The priority of the QoS rule. Valid values: 1 to 9000. A larger value indicates a higher priority. The priority of each QoS rule must be unique within a QoS policy."
    },
    "SrcIpv6Cidr": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SrcIpv6Cidr"
        ]
      },
      "Description": "The matched source IPv6 CIDR block."
    },
    "DstIpv6Cidr": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "DstIpv6Cidr"
        ]
      },
      "Description": "The matched destination IPv6 CIDR block."
    },
    "QosId": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "QosId"
        ]
      },
      "Description": "The ID of the QoS policy."
    },
    "SrcPortRange": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SrcPortRange"
        ]
      },
      "Description": "The matched source port range. Valid values: 0 to 65535. A value of -1/-1 means no port is matched. Only single ports are supported, where the start and end port numbers must be the same."
    },
    "RuleName": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleName"
        ]
      },
      "Description": "The name of the QoS rule."
    },
    "RemarkingDscp": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RemarkingDscp"
        ]
      },
      "Description": "The new DSCP value applied to the traffic. Valid values: 0 to 63. A value of -1 means the original DSCP value is retained."
    },
    "RuleDescription": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleDescription"
        ]
      },
      "Description": "The description of the QoS rule."
    }
  }
}