ALIYUN::ALB::SecurityGroupAttachment

ALIYUN::ALB::SecurityGroupAttachment类型用于为应用型负载均衡实例绑定已创建的安全组。

语法

{
  "Type": "ALIYUN::ALB::SecurityGroupAttachment",
  "Properties": {
    "LoadBalancerId": String,
    "SecurityGroupIds": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

LoadBalancerId

String

应用型负载均衡实例 ID。

SecurityGroupIds

List

安全组 ID 集合。

最多支持添加4个安全组。

返回值

Fn::GetAtt

示例

YAML

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  LoadBalancerId:
    Type: String
    Description:
      en: The ID of ALB instance.
    Required: true
  SecurityGroupIds:
    AssociationPropertyMetadata:
      Parameter:
        AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
        Type: String
        Required: true
    AssociationProperty: List[Parameter]
    Type: Json
    Description:
      en: The IDs of the security group to which the ALB instance join.
    Required: false
    MinLength: 0
    MaxLength: 4
Resources:
  SecurityGroupAttachment:
    Type: ALIYUN::ALB::SecurityGroupAttachment
    Properties:
      LoadBalancerId:
        Ref: LoadBalancerId
      SecurityGroupIds:
        Ref: SecurityGroupIds
                        

JSON

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "LoadBalancerId": {
      "Type": "String",
      "Description": {
        "en": "The ID of ALB instance."
      },
      "Required": true
    },
    "SecurityGroupIds": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
          "Type": "String",
          "Required": true
        }
      },
      "AssociationProperty": "List[Parameter]",
      "Type": "Json",
      "Description": {
        "en": "The IDs of the security group to which the ALB instance join."
      },
      "Required": false,
      "MinLength": 0,
      "MaxLength": 4
    }
  },
  "Resources": {
    "SecurityGroupAttachment": {
      "Type": "ALIYUN::ALB::SecurityGroupAttachment",
      "Properties": {
        "LoadBalancerId": {
          "Ref": "LoadBalancerId"
        },
        "SecurityGroupIds": {
          "Ref": "SecurityGroupIds"
        }
      }
    }
  }
}