Creates a custom throttling policy for API Gateway.
Syntax
{
"Type": "ALIYUN::ApiGateway::TrafficControl",
"Properties": {
"TrafficControlName": String,
"Description": String,
"UserDefault": String,
"AppDefault": String,
"TrafficControlUnit": String,
"Special": List,
"ApiDefault": Integer
}
}
Properties
|
Property |
Type |
Required |
Editable |
Description |
Constraint |
|
ApiDefault |
Integer |
Yes |
Yes |
Default throttling value per API. |
None. |
|
TrafficControlName |
String |
Yes |
Yes |
Name of the throttling policy. |
4 to 50 characters. Supports letters, digits, and underscores (_). Cannot start with an underscore. |
|
TrafficControlUnit |
String |
Yes |
Yes |
Time unit for the throttling policy. |
Valid values:
|
|
AppDefault |
String |
No |
Yes |
Default throttling value per application. |
None. |
|
Description |
String |
No |
Yes |
Description of the throttling policy. |
None. |
|
Special |
List |
No |
Yes |
Special throttling policies to add. |
None. |
|
UserDefault |
String |
No |
Yes |
Default throttling value per user. |
None. |
Special syntax
"Special": {
"SpecialType" : String,
"SpecialKey" : String,
"TrafficValue" : Integer
}
Special properties
|
Property |
Type |
Required |
Editable |
Description |
Constraint |
|
SpecialKey |
String |
Yes |
No |
Application ID or Alibaba Cloud account ID, depending on SpecialType. |
None. |
|
SpecialType |
String |
Yes |
No |
Type of the special throttling policy. |
Valid values:
|
|
TrafficValue |
Integer |
Yes |
No |
Throttling value for the specified target. |
None. |
Return values
Fn::GetAtt
TrafficControlId: ID of the throttling policy.
Examples
Replace masked parameter values with your actual values.
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
}
]
}
}
}
}