阅读884 返回首页    go 人物


ALIYUN::SLB::Listener__资源列表_资源编排-阿里云

ALIYUN::SLB::Listener 类型可用于创建 Listener。

语法

{
   "Type" : "ALIYUN::SLB::Listener",
   "Properties" : {
         "LoadBalancerId" : String,
      "ListenerPort" : String,
      "BackendServerPort" : String,
      "Bandwidth" : String,
      "Protocol" : String,
      "HealthCheck" : String,
      "Persistence" : String,
      "Scheduler" : String,
      "ServerCertificateId" : String
   }
}

属性

LoadBalancerId

负载均衡实例的唯一标识。

ListenerPort

负载均衡实例前端使用的端口。
取值:1-65535

BackendServerPort

负载均衡实例后端使用的端口。
取值:1-65535

Bandwidth

监听的带宽峰值。
取值:-1 | 1-1000Mbps 
针对按固定带宽计费方式的公网类型实例,
不同Listener上的Bandwidth分配的带宽峰值总和不能超出在创建负载均衡实例时设定的Bandwidth值,且不能将Listener上的Bandwidth设置为-1;
针对按使用流量计费方式的公网类型实例,可以选择将Listener上的Bandwidth设置为-1,表示不限制带宽峰值。

Protocol

传输协议。
可选值:'http' | 'https' | 'tcp' | 'udp'

HealthCheck

是否开启健康检查。
取值:on | off

Persistence

持久化相关参数对象,包含以下属性:

- PersistenceTimeout,连接持久化的超时时间。取值: 0-1000(单位为秒) 默认值:0 其中,0表示关闭。

- XForwardedFor,是否开启通过X-Forwarded-For的方式获取来访者真实IP。取值:on | off。默认值:on。注:考虑安全原因,本参数自2015年5月15日起会强制设置为on,考虑的接口兼容性,本接口入参还保留。

- StickySession,是否开启会话保持。取值:on | off

- StickySessionType,cookie的处理方式。该参数在StickySession为on时为必选;当StickySession为off时,此参数设置将被忽略。取值:insert | server设置为insert表示由负载均衡插入,设置为server表示负载均衡从后端服务器学习。

- CookieTimeout,cookie超时时间。该参数在StickySession为on且StickySessionType为insert时为必选,其余情况下该参数会被忽略。取值: 1-86400(单位为秒)

- Cookie 服务器上配置的cookie。仅在StickySession为on且StickySessionType为server时为必选;其余情况下该参数会被忽略。取值:遵守RFC 2965且长度为1-200的字符串。只能包含 ASCII 英文字母数字字符,不能包含逗号、分号或空格,也不能以 $ 字符开头。

Scheduler

调度算法。
取值:wrr | wlc
默认值:wrr

ServerCertificateId

安全证书的ID。

返回值

Fn::GetAtt

  • LoadBalancerId 负载均衡实例的唯一标识。

  • ListenerPortsAndProtocol 数组格式,负载均衡实例前端使用的端口和协议

示例

{
    "ROSTemplateFormatVersion": "2015-09-01",
    "Resources": {
        "LoadBalancer": {
            "Type": "ALIYUN::SLB::LoadBalancer",
            "Properties": {
                "LoadBalancerName": "createdByHeat",
                "AddressType": "internet",
                "InternetChargeType": "paybybandwidth"
            }
        },
        "CreateListener": {
            "Type": "ALIYUN::SLB::Listener",
            "Properties": {
                "LoadBalancerId": {"Ref": "LoadBalancer"},
                "ListenerPort": "8094",
                "BackendServerPort": 8080,
                "Bandwidth": 1,
                "Protocol": "http",
                "HealthCheck": {
                    "HealthyThreshold": 3,
                    "UnhealthyThreshold": 3,
                    "Interval": 2,
                    "Timeout": 5,
                    # "HealthCheckConnectTimeout": 5,
                    # "Port": 1,
                    # "Domain": 1,
                    # "URI": 1,
                    "HttpCode": "http_2xx,http_3xx,http_4xx,http_5xx"
                },
                "Scheduler": "wrr",
                # "Persistence": {
                #     "PersistenceTimeout": 1,
                #     "XForwardedFor": 1,
                #     "StickySession": 1,
                #     "StickySessionType": 1,
                #     "CookieTimeout": 0,
                #     "Cookie": 1
                # }
            }
        }
    },
    "Outputs": {
    "LoadBalanceDetails": {
         "Value" : {"get_attr": ["LoadBalancerId", "Listeners"]}
    }
  }
}

最后更新:2016-11-23 16:04:02

  上一篇:go ALIYUN::SLB::BackendServerAttachment__资源列表_资源编排-阿里云
  下一篇:go ALIYUN::SLB::LoadBalancer__资源列表_资源编排-阿里云