ALIYUN::VPC::NetworkAclAssociation类型用于绑定网络ACL到交换机。

语法

{
  "Type": "ALIYUN::VPC::NetworkAclAssociation",
  "Properties": {
    "NetworkAclId": String,
    "Resources": List
  }
}

属性

属性名称类型必须允许更新描述约束
NetworkAclIdString网络ACL的ID。
ResourcesList网络ACL关联的资源。最多支持关联20个资源。

更多信息,请参见Resources属性

Resources语法

"Resources": [
  {
    "ResourceId": String,
    "ResourceType": String
  }
]

Resources属性

属性名称类型必须允许更新描述约束
ResourceIdString资源ID。
ResourceTypeString资源类型。取值:VSwitch,表示交换机。

返回值

Fn::GetAtt

NetworkAclId:网络ACL的ID。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      NetworkAclId:
        Type: String
        Description: The ID of the network ACL.
      VSwitchId:
        Type: String
        AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    Resources:
      NetworkAclAssociation:
        Type: ALIYUN::VPC::NetworkAclAssociation
        Properties:
          NetworkAclId:
            Ref: NetworkAclId
          Resources:
            - ResourceId:
                Ref: VSwitchId
              ResourceType: VSwitch
    Outputs:
      NetworkAclId:
        Description: The ID of the network ACL.
        Value:
          Fn::GetAtt:
            - NetworkAclAssociation
            - NetworkAclId
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "NetworkAclId": {
          "Type": "String",
          "Description": "The ID of the network ACL."
        },
        "VSwitchId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId"
        }
      },
      "Resources": {
        "NetworkAclAssociation": {
          "Type": "ALIYUN::VPC::NetworkAclAssociation",
          "Properties": {
            "NetworkAclId": {
              "Ref": "NetworkAclId"
            },
            "Resources": [
              {
                "ResourceId": {
                  "Ref": "VSwitchId"
                },
                "ResourceType": "VSwitch"
              }
            ]
          }
        }
      },
      "Outputs": {
        "NetworkAclId": {
          "Description": "The ID of the network ACL.",
          "Value": {
            "Fn::GetAtt": [
              "NetworkAclAssociation",
              "NetworkAclId"
            ]
          }
        }
      }
    }