ALIYUN::SAE::NlbBinding

更新时间:
复制为 MD 格式

ALIYUN::SAE::NlbBinding类型用于为应用绑定NLB。

语法

{
  "Type": "ALIYUN::SAE::NlbBinding",
  "Properties": {
    "AppId": String,
    "Listeners": List,
    "NlbId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

AppId

String

SAE应用的ID。

Listeners

List

NLB的监听器。

长度最大值为1。更多信息,请参考Listeners属性

NlbId

String

网络型负载均衡(NLB)实例的ID。

Listeners语法

"Listeners": [
  {
    "TargetPort": Integer,
    "CertIds": String,
    "Port": Integer,
    "Protocol": String
  }
]

Listeners属性

属性名称

类型

必须

允许更新

描述

约束

Port

Integer

监听器的端口。

取值范围:065535。

Protocol

String

监听器的协议。

取值:

  • TCP

  • UDP

  • TCPSSL

TargetPort

Integer

监听器的目标端口。

取值范围:065535。

CertIds

String

监听器的证书ID。

返回值

Fn::GetAtt

NlbId:网络型负载均衡(NLB)的ID。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  AppId:
    Type: String
    Description:
      en: The ID of the SAE application.
    Required: true
  NlbId:
    Type: String
    Description:
      en: The ID of the Network Load Balancer (NLB).
    Required: true
  Listeners:
    Description:
      en: The listeners of the NLB.
    Required: true
    Type: Json
    MaxLength: 1
    AssociationProperty: List[Parameters]
    AssociationPropertyMetadata:
      Parameters:
        Port:
          Type: Number
          Description:
            en: The port of the listener.
          MinValue: 0
          MaxValue: 65535
          Required: true
        TargetPort:
          Type: Number
          Description:
            en: The target port of the listener.
          MinValue: 0
          MaxValue: 65535
          Required: true
        Protocol:
          Type: String
          Description:
            en: The protocol of the listener.
          AllowedValues:
            - TCP
            - UDP
            - TCPSSL
          Required: true
        CertIds:
          Type: String
          Description:
            en: The certificate ID of the listener.
          Default: Null
          Required: false
Resources:
  NlbBinding:
    Type: ALIYUN::SAE::NlbBinding
    Properties:
      AppId:
        Ref: AppId
      NlbId:
        Ref: NlbId
      Listeners:
        Ref: Listeners
Outputs:
  NlbId:
    Value:
      Fn::GetAtt:
        - NlbBinding
        - NlbId
    Description: The ID of the Network Load Balancer (NLB).
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "AppId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the SAE application."
      },
      "Required": true
    },
    "NlbId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the Network Load Balancer (NLB)."
      },
      "Required": true
    },
    "Listeners": {
      "Description": {
        "en": "The listeners of the NLB."
      },
      "Required": true,
      "Type": "Json",
      "MaxLength": 1,
      "AssociationProperty": "List[Parameters]",
      "AssociationPropertyMetadata": {
        "Parameters": {
          "Port": {
            "Type": "Number",
            "Description": {
              "en": "The port of the listener."
            },
            "MinValue": 0,
            "MaxValue": 65535,
            "Required": true
          },
          "TargetPort": {
            "Type": "Number",
            "Description": {
              "en": "The target port of the listener."
            },
            "MinValue": 0,
            "MaxValue": 65535,
            "Required": true
          },
          "Protocol": {
            "Type": "String",
            "Description": {
              "en": "The protocol of the listener."
            },
            "AllowedValues": [
              "TCP",
              "UDP",
              "TCPSSL"
            ],
            "Required": true
          },
          "CertIds": {
            "Type": "String",
            "Description": {
              "en": "The certificate ID of the listener."
            },
            "Default": null,
            "Required": false
          }
        }
      }
    }
  },
  "Resources": {
    "NlbBinding": {
      "Type": "ALIYUN::SAE::NlbBinding",
      "Properties": {
        "AppId": {
          "Ref": "AppId"
        },
        "NlbId": {
          "Ref": "NlbId"
        },
        "Listeners": {
          "Ref": "Listeners"
        }
      }
    }
  },
  "Outputs": {
    "NlbId": {
      "Value": {
        "Fn::GetAtt": [
          "NlbBinding",
          "NlbId"
        ]
      },
      "Description": "The ID of the Network Load Balancer (NLB)."
    }
  }
}