ALIYUN::ALB::AclAssociation类型用于关联ACL到监听。

语法

{
  "Type": "ALIYUN::ALB::AclAssociation",
  "Properties": {
    "AclType": String,
    "AclIds": List,
    "ListenerId": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
AclType String 访问控制类型。 取值:
  • White: 仅转发来自所选访问控制策略组中设置的IP地址或地址段的请求,白名单适用于只允许特定IP访问的场景。

    设置白名单存在一定业务风险。一旦设置白名单,就只有白名单中的IP可以访问负载均衡监听。

    如果开启了白名单访问,但访问策略组中没有添加任何IP,则负载均衡监听会转发全部请求。
  • Black: 所选访问控制策略组中设置的IP地址或地址段的所有请求都不会转发。黑名单适用于只限制某些特定IP访问的场景。

    如果开启了黑名单访问,但访问策略组中没有添加任何IP,则负载均衡监听会转发全部请求。

AclIds List 访问控制策略组ID列表。 最多支持3个ACL实例ID。
ListenerId String 监听实例ID。

返回值

Fn::GetAtt

ListenerId:监听实例ID。

示例

  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "AclType": {
          "Type": "String",
          "Description": "The type of ACL.",
          "AllowedValues": [
            "White",
            "Black"
          ]
        },
        "AclIds": {
          "Type": "Json",
          "Description": "The IDs of the ACLs. You can specify up to three IDs at a time.",
          "MinLength": 1,
          "MaxLength": 3
        },
        "ListenerId": {
          "Type": "String",
          "Description": "The ID of the listener."
        }
      },
      "Resources": {
        "AclAssociation": {
          "Type": "ALIYUN::ALB::AclAssociation",
          "Properties": {
            "AclType": {
              "Ref": "AclType"
            },
            "AclIds": {
              "Ref": "AclIds"
            },
            "ListenerId": {
              "Ref": "ListenerId"
            }
          }
        }
      },
      "Outputs": {
        "ListenerId": {
          "Description": "The ID of the listener.",
          "Value": {
            "Fn::GetAtt": [
              "AclAssociation",
              "ListenerId"
            ]
          }
        }
      }
    }
  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      AclIds:
        Description: The IDs of the ACLs. You can specify up to three IDs at a time.
        MaxLength: 3
        MinLength: 1
        Type: Json
      AclType:
        AllowedValues:
        - White
        - Black
        Description: The type of ACL.
        Type: String
      ListenerId:
        Description: The ID of the listener.
        Type: String
    Resources:
      AclAssociation:
        Properties:
          AclIds:
            Ref: AclIds
          AclType:
            Ref: AclType
          ListenerId:
            Ref: ListenerId
        Type: ALIYUN::ALB::AclAssociation
    Outputs:
      ListenerId:
        Description: The ID of the listener.
        Value:
          Fn::GetAtt:
          - AclAssociation
          - ListenerId