All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DDoSPro::SchedulerRule

Last Updated:Aug 12, 2024

ALIYUN::DDoSPro::SchedulerRule is used to create a scheduling rule for Sec-Traffic Manager.

Syntax

{
  "Type": "ALIYUN::DDoSPro::SchedulerRule",
  "Properties": {
    "ResourceGroupId": String,
    "Param": String,
    "RuleType": Integer,
    "Rules": String,
    "RuleName": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

RuleName

String

Yes

No

The name of the scheduling rule.

None.

Rules

String

Yes

No

The details of the scheduling rule. The value of this property must be a JSON string.

The value of Rules contains the following fields:

  • Type: the address type of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the string type. Valid values:

    • A: IP address

    • CNAME: domain name

  • Value: the address of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the string type.

  • Priority: the priority of the scheduling rule. This field is required and must be of the integer type. Valid values: 0 to 100. A larger value indicates a higher priority.

  • ValueType: the type of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the integer type. Valid values:

    • 1: the IP address of an Anti-DDoS Proxy instance

    • 2: the IP address of an interaction resource in a tiered protection scenario

    • 3: the IP address that is used to accelerate access in a network acceleration scenario

    • 5: the domain name that is configured in Alibaba Cloud CDN (CDN) in a CDN interaction scenario

    • 6: the IP address of the interaction resource in a cloud service interaction scenario

  • RegionId: the region ID. This field is required when ValueType is set to 2 and must be of the string type.

RuleType

Integer

Yes

No

The type of the scheduling rule.

Valid values:

  • 2: tiered protection

  • 3: network acceleration

  • 5: CDN interaction

  • 6: cloud service interaction

  • 8: secure acceleration

Param

String

No

No

The details of the CDN interaction rule. The value of this property must be a JSON string.

The value of Param contains the following fields:

  • ParamType: the type of the scheduling rule. This field is required and must be of the string type. Set the value to cdn. A value of cdn specifies a CDN interaction rule.

  • ParamData: the parameters that you want to configure for the CDN interaction rule. This field is required and must be of the map type. The value of ParamData contains the following fields:

    • Domain: the accelerated domain name in CDN. This field is required and must be of the string type.

    • Cname: the canonical name (CNAME) that is assigned to the accelerated domain name. This field is required and must be of the string type.

    • AccessQps: the queries per second (QPS) threshold that is used to switch traffic to Anti-DDoS Proxy. This field is required and must be of the integer type. If the actual QPS exceeds the threshold, traffic is switched to Anti-DDoS Proxy.

    • UpstreamQps: the QPS threshold that is used to switch traffic to CDN. This field is optional and must be of the integer type. If the actual QPS is lower than the threshold, traffic is switched to CDN.

Example:

{"ParamType":"cdn","ParamData":{"Domain":"example.aliyundoc.com","Cname":"demo.aliyundoc.com","AccessQps":100,"UpstreamQps":100}}

ResourceGroupId

String

No

No

The ID of the resource group to which the Anti-DDoS Proxy instance belongs in Resource Management.

By default, this property is empty. If you leave this property empty, the instance belongs to the default resource group.

Return values

Fn::GetAtt

RuleName: the rule name.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  RuleType:
    Type: Number
    Description:
      en: |-
        The type of the custom defense rule. Valid values: 
        2: tiered protection 
        3: network acceleration 
        5: CDN interaction 
        6: cloud service interaction
    Required: true
  Rules:
    Type: String
    Description:
      en: |-
        The details of the scheduling rule. This parameter is a JSON string. The following list describes the fields in the value of the parameter: 
        Type: the address type of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the string type. Valid values: A: IP address. CNAME: domain name
        Value: the address of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the string type.
        Priority: the priority of the scheduling rule. This field is required and must be of the integer type. Valid values: 0 to 100. A larger value indicates a higher priority.
        ValueType: the type of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the integer type. Valid values: 1: the IP address of the Anti-DDoS Pro or Anti-DDoS Premium instance. 2: the IP address of the interaction resource in the tiered protection scenario. 3: the IP address that is used to accelerate access in the network acceleration scenario. 5: the domain name that is configured in Alibaba Cloud CDN (CDN) in the CDN interaction scenario. 6 the IP address of the interaction resource in the cloud service interaction scenario 
        RegionId: the region where the interaction resource is deployed. This parameter must be specified when ValueType is set to 2. The value must be of the string type.
    Required: true
  RuleName:
    Type: String
    Description:
      en: The name of the rule.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::DDoSPro::SchedulerRule
    Properties:
      RuleType:
        Ref: RuleType
      Rules:
        Ref: Rules
      RuleName:
        Ref: RuleName
Outputs:
  RuleName:
    Description: The name of the rule.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleName

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "RuleType": {
      "Type": "Number",
      "Description": {
        "en": "The type of the custom defense rule. Valid values: \n2: tiered protection \n3: network acceleration \n5: CDN interaction \n6: cloud service interaction"
      },
      "Required": true
    },
    "Rules": {
      "Type": "String",
      "Description": {
        "en": "The details of the scheduling rule. This parameter is a JSON string. The following list describes the fields in the value of the parameter: \nType: the address type of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the string type. Valid values: A: IP address. CNAME: domain name\nValue: the address of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the string type.\nPriority: the priority of the scheduling rule. This field is required and must be of the integer type. Valid values: 0 to 100. A larger value indicates a higher priority.\nValueType: the type of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the integer type. Valid values: 1: the IP address of the Anti-DDoS Pro or Anti-DDoS Premium instance. 2: the IP address of the interaction resource in the tiered protection scenario. 3: the IP address that is used to accelerate access in the network acceleration scenario. 5: the domain name that is configured in Alibaba Cloud CDN (CDN) in the CDN interaction scenario. 6 the IP address of the interaction resource in the cloud service interaction scenario \nRegionId: the region where the interaction resource is deployed. This parameter must be specified when ValueType is set to 2. The value must be of the string type."
      },
      "Required": true
    },
    "RuleName": {
      "Type": "String",
      "Description": {
        "en": "The name of the rule."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::DDoSPro::SchedulerRule",
      "Properties": {
        "RuleType": {
          "Ref": "RuleType"
        },
        "Rules": {
          "Ref": "Rules"
        },
        "RuleName": {
          "Ref": "RuleName"
        }
      }
    }
  },
  "Outputs": {
    "RuleName": {
      "Description": "The name of the rule.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleName"
        ]
      }
    }
  }
}