ALIYUN::ApiGateway::TrafficControl is used to create a user-defined throttling policy.

Syntax

{
  "Type": "ALIYUN::ApiGateway::TrafficControl",
  "Properties": {
    "TrafficControlName": String,
    "Description": String,
    "UserDefault": String,
    "AppDefault": String,
    "TrafficControlUnit": String,
    "Special": List,
    "ApiDefault": Integer
  }
}

Properties

Name Type Required Editable Description
TrafficControlName String Yes Yes The name of the throttling policy. The name must be 4 to 50 characters in length and can contain letters, digits, and underscores (_). It cannot start with an underscore (_).
TrafficControlUnit String Yes Yes The unit of the throttling policy. Valid values: MINUTE, HOUR, and DAY.
ApiDefault Integer Yes Yes The default throttling value for each API.
Description String No Yes The description of the throttling policy.
UserDefault String No Yes The default throttling value for each user.
AppDefault String No Yes The default throttling value for each application.
Special List No Yes The list of special throttling policies.

Special syntax

"Special": {
  "SpecialType" : String,
  "SpecialKey" : String,
  "TrafficValue" : Integer
}

Special properties

Name Type Required Editable Description
SpecialType String Yes No The special throttling type. Valid values: APP and USER.
SpecialKey String Yes No The application ID or Alibaba Cloud account ID corresponding to the special throttling type.
TrafficValue Integer Yes No The special throttling value.

Response parameters

Fn::GetAtt

TrafficControlId: the ID of the user-defined throttling policy.

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "AppId": {
      "Type": "String",
      "Description": "Special APP ID"
    }
  },
  "Resources": {
    "TrafficControl": {
      "Type": "ALIYUN::ApiGateway::TrafficControl",
      "Properties": {
        "TrafficControlName": "test_traffic_control1",
        "TrafficControlUnit": "MINUTE",
        "ApiDefault": 400,
        "UserDefault": 200,
        "AppDefault": 100,
        "Description": "demo2",
        "Special": [
          {
            "SpecialType": "APP",
            "SpecialKey": {
              "Ref": "AppId"
            },
            "TrafficValue": 80
          }
        ]
      }
    }
  }
}