ALIYUN::ApiGateway::TrafficControl is used to create a custom throttling policy.

Syntax

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

Properties

PropertyTypeRequiredEditableDescriptionConstraint
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 (_). The name cannot start with an underscore (_).
TrafficControlUnit String Yes Yes The unit for the throttling policy.Valid values:
  • MINUTE
  • HOUR
  • DAY
ApiDefault Integer Yes Yes The default throttling value for each API. None.
Description String No Yes The description of the throttling policy. None.
UserDefault String No Yes The default throttling value for each user. None.
AppDefault String No Yes The default throttling value for each application. None.
Special List No Yes Details of the special policy that you want to add to the custom throttling policy. None.

Special syntax

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

Special properties

PropertyTypeRequiredEditableDescriptionConstraint
SpecialType String Yes No The type of the special throttling policy. Valid values:
  • APP
  • USER
SpecialKey String Yes No The ID of the application or Alibaba Cloud account. Specify the value based on the value of the SpecialType property. None.
TrafficValue Integer Yes No The special throttling value. None.

Return values

Fn::GetAtt

TrafficControlId: the ID of the custom throttling policy.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      AppId:
        Type: String
        Description: The ID of the application in the special throttling policy.
    Resources:
      TrafficControl:
        Type: ALIYUN::ApiGateway::TrafficControl
        Properties:
          TrafficControlName: test_traffic_cont****
          TrafficControlUnit: MINUTE
          ApiDefault: 400
          UserDefault: 200
          AppDefault: 100
          Description: demo2
          Special:
            - SpecialType: APP
              SpecialKey:
                Ref: AppId
              TrafficValue: 80
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "AppId": {
          "Type": "String",
          "Description": "The ID of the application in the special throttling policy."
        }
      },
      "Resources": {
        "TrafficControl": {
          "Type": "ALIYUN::ApiGateway::TrafficControl",
          "Properties": {
            "TrafficControlName": "test_traffic_cont****",
            "TrafficControlUnit": "MINUTE",
            "ApiDefault": 400,
            "UserDefault": 200,
            "AppDefault": 100,
            "Description": "demo2",
            "Special": [
              {
                "SpecialType": "APP",
                "SpecialKey": {
                  "Ref": "AppId"
                },
                "TrafficValue": 80
              }
            ]
          }
        }
      }
    }