如何使用 CloudFormation 为 Classic Load Balancer 创建多个侦听器?

How to create multiple listeners for Classic Load Balancer using CloudFormation?

我想知道是否可以使用 CloudFormation 模板为 Classic Load Balancer 添加多个侦听器规则?

我尝试添加侦听器规则,但没有成功,我被告知我们不能使用 CloudFormation 模板添加多个规则。

AWS 文档说我们可以像下面这样使用,但是我可以在这里添加多个侦听器吗?

{
  "InstancePort" : String,
  "InstanceProtocol" : String,
  "LoadBalancerPort" : String,
  "PolicyNames" :  [ String, ... ],
  "Protocol" : String,
  "SSLCertificateId" : String
}

这是来自 cloud-formation-templates/load-balancers.template at master · markitx/cloud-formation-templates 的示例:

    "Listeners" : 
      [ {
        "LoadBalancerPort" : "80",
        "InstancePort" : "80",
        "Protocol" : "HTTP"
      },
      {
        "LoadBalancerPort": "443",
        "InstancePort" : "8080",
        "Protocol" : "HTTPS",
        "PolicyNames" : [ "HTTPSCookieStickinessPolicy" ],
        "SSLCertificateId" : "TODO: ARN for your SSL certificate here or remote HTTPS support"
      } ],