ALIYUN::VPC::NetworkAclAssociation is used to associate a network access control list (ACL) with a vSwitch.

Syntax

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

Properties

PropertyTypeRequiredEditableDescriptionConstraint
NetworkAclIdStringYesNoThe description of the network ACL. None
ResourcesListYesNoThe resources associated with the network ACL. A maximum of 20 resources can be associated.

For more information, see Resources properties.

Resources syntax

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

Resources properties

PropertyTypeRequiredEditableDescriptionConstraint
ResourceIdStringYesNoThe ID of the resource. None
ResourceTypeStringNoNoThe type of the resource. Set the value to vSwitch.

Response parameters

Fn::GetAtt

NetworkAclId: the ID of the network ACL.

Examples

  • YAMLformat

    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
  • JSONformat

    {
      "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"
            ]
          }
        }
      }
    }