ALIYUN::GWLB::Listener类型用于创建监听。
语法
{
"Type": "ALIYUN::GWLB::Listener",
"Properties": {
"LoadBalancerId": String,
"ServerGroupId": String,
"ListenerDescription": String,
"Tags": List
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
LoadBalancerId | String | 是 | 否 | 网关型负载均衡实例的 ID。 | 无 |
ServerGroupId | String | 是 | 否 | 服务器组 ID。 | 无 |
ListenerDescription | String | 否 | 是 | 自定义监听描述。 | 长度限制为 2~256 个字符,支持中文和英文字母,可包含数字、半角逗号(,)、半角句号(.)、半角分号(;)、正斜线(/)、at(@)、下划线(_)和短划线(-)。 |
Tags | List | 否 | 是 | 负载均衡实例绑定的标签列表。 | 最多支持添加 20 个标签。更多信息,请参考Tags属性。 |
Tags语法
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Key | String | 是 | 否 | 标签键。 | 一旦传入该值,则不允许为空字符串。最多支持 128 个字符,不能以 |
Value | String | 否 | 否 | 标签值。 | 最多支持 256 个字符,不能包含 |
返回值
Fn::GetAtt
ListenerDescription:自定义监听描述。
ServerGroupId:服务器组 ID。
LoadBalancerId:网关型负载均衡实例的 ID。
Tags:负载均衡实例绑定的标签列表。
ListenerId:监听 ID。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
ServerGroupId:
Type: String
Description:
en: The ID of the server group.
Required: true
LoadBalancerId:
Type: String
Description:
en: The ID of the gateway load balancer instance.
Required: true
Resources:
ExtensionResource:
Type: ALIYUN::GWLB::Listener
Properties:
ServerGroupId:
Ref: ServerGroupId
LoadBalancerId:
Ref: LoadBalancerId
Outputs:
ListenerDescription:
Description: The custom listener description.
Value:
Fn::GetAtt:
- ExtensionResource
- ListenerDescription
ServerGroupId:
Description: The ID of the server group.
Value:
Fn::GetAtt:
- ExtensionResource
- ServerGroupId
LoadBalancerId:
Description: The ID of the gateway load balancer instance.
Value:
Fn::GetAtt:
- ExtensionResource
- LoadBalancerId
Tags:
Description: The list of tags.
Value:
Fn::GetAtt:
- ExtensionResource
- Tags
ListenerId:
Description: The ID of listener.
Value:
Fn::GetAtt:
- ExtensionResource
- ListenerId
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"ServerGroupId": {
"Type": "String",
"Description": {
"en": "The ID of the server group."
},
"Required": true
},
"LoadBalancerId": {
"Type": "String",
"Description": {
"en": "The ID of the gateway load balancer instance."
},
"Required": true
}
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::GWLB::Listener",
"Properties": {
"ServerGroupId": {
"Ref": "ServerGroupId"
},
"LoadBalancerId": {
"Ref": "LoadBalancerId"
}
}
}
},
"Outputs": {
"ListenerDescription": {
"Description": "The custom listener description.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ListenerDescription"
]
}
},
"ServerGroupId": {
"Description": "The ID of the server group.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ServerGroupId"
]
}
},
"LoadBalancerId": {
"Description": "The ID of the gateway load balancer instance.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"LoadBalancerId"
]
}
},
"Tags": {
"Description": "The list of tags.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Tags"
]
}
},
"ListenerId": {
"Description": "The ID of listener.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ListenerId"
]
}
}
}
}
该文章对您有帮助吗?