ALIYUN::DDoSPro::WebRule类型用于创建一条网站业务转发规则。
语法
{
"Type": "ALIYUN::DDoSPro::WebRule",
"Properties": {
"RsType": Integer,
"ResourceGroupId": String,
"DefenseId": String,
"Domain": String,
"InstanceIds": List,
"Rules": String,
"HttpsExt": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Domain | String | 是 | 否 | 要接入DDoS高防进行防护的网站域名。 | 无 |
RsType | Integer | 是 | 否 | 源站服务器的地址类型。 | 取值:
|
Rules | String | 是 | 否 | 网站业务转发规则的详细配置。 | 使用JSON数组转化的字符串格式表示。JSON数组中的每个元素是一个JSON结构体,包含以下字段:
|
DefenseId | String | 否 | 否 | 要关联的防护ID。 | 无 |
HttpsExt | String | 否 | 否 | HTTPS 高级设置,仅在网站协议类型支持 HTTPS(ProxyType包含https)时生效。 | 使用JSON结构体转化的字符串格式表示,JSON结构体包含以下字段:
|
InstanceIds | List | 否 | 否 | 要关联的DDoS高防实例的ID列表。 | 无 |
ResourceGroupId | String | 否 | 否 | DDoS高防实例在资源管理服务中所属的资源组ID。 | 无 |
返回值
Fn::GetAtt
Domain:接入DDoS高防进行防护的网站域名。
示例
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
RsType:
Type: Number
Description:
en: |-
The address type of the origin server. Valid values:
0: IP address
1: domain name The domain name of the origin server is returned if you deploy proxies, such as Web Application Firewall (WAF), between the origin server and the instance. In this case, the address of the proxy, such as the CNAME provided by WAF, is returned.
Required: true
Domain:
Type: String
Description:
en: The domain name of the website that you want to add to the instance.
Required: true
Rules:
Type: String
Description:
en: |-
The details of the forwarding rule. The value is a string that consists of JSON arrays. Each element in a JSON array is a JSON struct that contains the following fields:
ProxyRules: the information about the origin server. The information includes the port number and IP address. This field is required and must be a JSON array. Each element in a JSON array is a JSON struct that contains the following fields: ProxyPort: the port number. This field is required and must be an integer; RealServers: the IP address. This field is required and must be a string array.
ProxyType: the protocol type. This field is required and must be a string. Valid values: http, https, websocket, and websockets.
Required: true
Resources:
ExtensionResource:
Type: ALIYUN::DDoSPro::WebRule
Properties:
RsType:
Ref: RsType
Domain:
Ref: Domain
Rules:
Ref: Rules
Outputs:
Domain:
Description: The domain name of the website that you want to add to the instance.
Value:
Fn::GetAtt:
- ExtensionResource
- Domain
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"RsType": {
"Type": "Number",
"Description": {
"en": "The address type of the origin server. Valid values:\n0: IP address\n1: domain name The domain name of the origin server is returned if you deploy proxies, such as Web Application Firewall (WAF), between the origin server and the instance. In this case, the address of the proxy, such as the CNAME provided by WAF, is returned."
},
"Required": true
},
"Domain": {
"Type": "String",
"Description": {
"en": "The domain name of the website that you want to add to the instance."
},
"Required": true
},
"Rules": {
"Type": "String",
"Description": {
"en": "The details of the forwarding rule. The value is a string that consists of JSON arrays. Each element in a JSON array is a JSON struct that contains the following fields: \nProxyRules: the information about the origin server. The information includes the port number and IP address. This field is required and must be a JSON array. Each element in a JSON array is a JSON struct that contains the following fields: ProxyPort: the port number. This field is required and must be an integer; RealServers: the IP address. This field is required and must be a string array.\nProxyType: the protocol type. This field is required and must be a string. Valid values: http, https, websocket, and websockets."
},
"Required": true
}
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::DDoSPro::WebRule",
"Properties": {
"RsType": {
"Ref": "RsType"
},
"Domain": {
"Ref": "Domain"
},
"Rules": {
"Ref": "Rules"
}
}
}
},
"Outputs": {
"Domain": {
"Description": "The domain name of the website that you want to add to the instance.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Domain"
]
}
}
}
}