Todos los productos
Search
Centro de documentos

Resource Orchestration Service:ALIYUN::ENS::NetworkAcl

Última actualización: Sep 04, 2026

ALIYUN::ENS::NetworkAcl crea una lista de control de acceso (ACL) de red para Edge Node Service (ENS).

Sintaxis

{
  "Type": "ALIYUN::ENS::NetworkAcl",
  "Properties": {
    "AclEntries": List,
    "Description": String,
    "NetworkAclName": String
  }
}

Propiedades

Propiedad

Tipo

Obligatorio

Editable

Descripción

Restricción

AclEntries

List

No

Sí

Reglas de la ACL de red.

Es posible configurar hasta 40 reglas. Para más información, consulte AclEntries properties.

Description

String

No

No

Descripción de la ACL de red.

Debe tener entre 1 y 256 caracteres. No puede comenzar con http:// o https://.

NetworkAclName

String

No

No

Nombre de la ACL de red.

Debe tener entre 1 y 128 caracteres. No puede comenzar con http:// o https://.

Sintaxis de AclEntries

"AclEntries": [
  {
    "Policy": String,
    "PortRange": String,
    "Description": String,
    "Priority": Integer,
    "CidrBlock": String,
    "Protocol": String,
    "NetworkAclEntryName": String,
    "Direction": String
  }
]

Propiedades de AclEntries

Propiedad

Tipo

Obligatorio

Editable

Descripción

Restricción

CidrBlock

String

Sí

Sí

Bloque CIDR de origen.

Ninguna.

Direction

String

Sí

Sí

Dirección de la regla.

Valores válidos:

  • ingress: entrada

  • egress: salida

Policy

String

Sí

Sí

Acción que se aplica al tráfico de red coincidente.

Valores válidos:

  • accept: permite el tráfico de red.

  • drop: deniega el tráfico de red.

PortRange

String

Sí

Sí

Rango de puertos.

  • Si Protocol es all o icmp, el valor válido es -1/-1, que representa todos los puertos.

  • Si Protocol es tcp o udp, el formato es X/Y, donde X es el puerto inicial e Y el puerto final. Ambos valores oscilan entre 1 y 65535. Por ejemplo, 1/200 abarca del puerto 1 al 200, y 80/80 corresponde al puerto 80.

Priority

Integer

Sí

Sí

Prioridad de la regla.

Valores válidos: 1 a 100. Valor predeterminado: 1.

Protocol

String

Sí

Sí

Tipo de protocolo.

Valores válidos:

  • icmp

  • tcp

  • udp

  • all

Description

String

No

No

Descripción de la ACL de red.

Debe tener entre 1 y 256 caracteres. No puede comenzar con http:// o https://.

NetworkAclEntryName

String

No

No

Nombre de la regla.

Debe tener entre 1 y 128 caracteres. No puede comenzar con http:// o https://.

Valores de retorno

Fn::GetAtt

NetworkAclId: ID de la ACL de red.

Ejemplos

Formato YAML

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  AclEntries:
    AssociationPropertyMetadata:
      Parameters:
        Policy:
          Type: String
          Description:
            en: |-
              The action that is performed on network traffic that matches the rule. Valid values: 
              accept: allows network traffic.
              drop: blocks network traffic.
          AllowedValues:
            - accept
            - drop
          Required: true
        PortRange:
          Type: String
          Description:
            en: The port range. If you set Protocol to all or icmp, set this parameter to -1/-1, which specifies all ports. If you set Protocol to tcp or udp, the port can be 1 to 65535. You can set this parameter to 1/200 or 80/80, which specifies ports 1 to 200 or port 80.
          Required: true
        Description:
          AssociationProperty: TextArea
          Type: String
          Description:
            en: The description of the network ACL. The description must be 1 to 256 characters in length and cannot start with http:// or https://.
          Required: false
        Priority:
          Type: Number
          Description:
            en: 'The priority of the rule. Valid values: 1 to 100. Default value: 1.'
          Required: true
          MinValue: 1
          MaxValue: 100
        CidrBlock:
          Type: String
          Description:
            en: The source CIDR block.
          Required: true
        NetworkAclEntryName:
          Type: String
          Description:
            en: The name of the rule. The name must be 1 to 128 characters in length and cannot start with http:// or https://.
          Required: false
        Protocol:
          Type: String
          Description:
            en: |-
              The protocol. Valid values: icmp: ICMP
              tcp: TCP
              udp: UDP
              all: all protocols
          AllowedValues:
            - icmp
            - tcp
            - udp
            - all
          Required: true
        Direction:
          Type: String
          Description:
            en: |-
              Specifies whether the ACL rule controls inbound or outbound access requests. Valid values: 
              ingress
              egress
          AllowedValues:
            - ingress
            - egress
          Required: true
    AssociationProperty: List[Parameters]
    Type: Json
    Description:
      en: The entry of Network ACL.
    Required: false
    MaxLength: 40
  NetworkAclName:
    Type: String
    Description:
      en: |-
        Enter a name for the network ACL.
        The name must be 1 to 128 characters in length and cannot start with http:// or https://.
    Required: false
Resources:
  NetworkAcl:
    Type: ALIYUN::ENS::NetworkAcl
    Properties:
      AclEntries:
        Ref: AclEntries
      NetworkAclName:
        Ref: NetworkAclName
Outputs:
  NetworkAclId:
    Description: The ID of the network ACL.
    Value:
      Fn::GetAtt:
        - NetworkAcl
        - NetworkAclId

Formato JSON

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "AclEntries": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "Policy": {
            "Type": "String",
            "Description": {
              "en": "The action that is performed on network traffic that matches the rule. Valid values: \naccept: allows network traffic.\ndrop: blocks network traffic."
            },
            "AllowedValues": [
              "accept",
              "drop"
            ],
            "Required": true
          },
          "PortRange": {
            "Type": "String",
            "Description": {
              "en": "The port range. If you set Protocol to all or icmp, set this parameter to -1/-1, which specifies all ports. If you set Protocol to tcp or udp, the port can be 1 to 65535. You can set this parameter to 1/200 or 80/80, which specifies ports 1 to 200 or port 80."
            },
            "Required": true
          },
          "Description": {
            "AssociationProperty": "TextArea",
            "Type": "String",
            "Description": {
              "en": "The description of the network ACL. The description must be 1 to 256 characters in length and cannot start with http:// or https://."
            },
            "Required": false
          },
          "Priority": {
            "Type": "Number",
            "Description": {
              "en": "The priority of the rule. Valid values: 1 to 100. Default value: 1."
            },
            "Required": true,
            "MinValue": 1,
            "MaxValue": 100
          },
          "CidrBlock": {
            "Type": "String",
            "Description": {
              "en": "The source CIDR block."
            },
            "Required": true
          },
          "NetworkAclEntryName": {
            "Type": "String",
            "Description": {
              "en": "The name of the rule. The name must be 1 to 128 characters in length and cannot start with http:// or https://."
            },
            "Required": false
          },
          "Protocol": {
            "Type": "String",
            "Description": {
              "en": "The protocol. Valid values: icmp: ICMP\ntcp: TCP\nudp: UDP\nall: all protocols"
            },
            "AllowedValues": [
              "icmp",
              "tcp",
              "udp",
              "all"
            ],
            "Required": true
          },
          "Direction": {
            "Type": "String",
            "Description": {
              "en": "Specifies whether the ACL rule controls inbound or outbound access requests. Valid values: \ningress\negress"
            },
            "AllowedValues": [
              "ingress",
              "egress"
            ],
            "Required": true
          }
        }
      },
      "AssociationProperty": "List[Parameters]",
      "Type": "Json",
      "Description": {
        "en": "The entry of Network ACL."
      },
      "Required": false,
      "MaxLength": 40
    },
    "NetworkAclName": {
      "Type": "String",
      "Description": {
        "en": "Enter a name for the network ACL.\nThe name must be 1 to 128 characters in length and cannot start with http:// or https://."
      },
      "Required": false
    }
  },
  "Resources": {
    "NetworkAcl": {
      "Type": "ALIYUN::ENS::NetworkAcl",
      "Properties": {
        "AclEntries": {
          "Ref": "AclEntries"
        },
        "NetworkAclName": {
          "Ref": "NetworkAclName"
        }
      }
    }
  },
  "Outputs": {
    "NetworkAclId": {
      "Description": "The ID of the network ACL.",
      "Value": {
        "Fn::GetAtt": [
          "NetworkAcl",
          "NetworkAclId"
        ]
      }
    }
  }
}