ALIYUN::ECS::PrefixList is used to create a prefix list.

Syntax

{
  "Type": "ALIYUN::ECS::PrefixList",
  "Properties": {
    "MaxEntries": Integer,
    "Description": String,
    "PrefixListName": String,
    "Entries": List,
    "AddressFamily": String
  }
}

Properties

Property Type Required Editable Description Constraint
MaxEntries Integer Yes No The maximum number of entries in the prefix list. Valid values: 1 to 200.
Description String No Yes The description of the prefix list. The description must be 2 to 256 characters in length. It cannot start with http:// or https://. By default, this property is empty.
PrefixListName String Yes Yes The name of the prefix list. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http://, https://, com.aliyun, or com.alibabacloud. The name can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
Entries List No Yes The details of entries in the prefix list. You can specify up to 200 entries.

For more information, see Entries properties.

AddressFamily String Yes No The IP address family of entries in the prefix list. Valid values:
  • IPv4
  • IPv6

Entries syntax

"Entries": [
  {
    "Description": String,
    "Cidr": String
  }
]

Entries properties

Property Type Required Editable Description Constraint
Description String No No The description that is contained in the entry. The description must be 2 to 32 characters in length, and can contain letters. The description cannot start with http:// or https://.
Cidr String Yes No The CIDR block that is contained in the entry.

The CIDR block must meet the following conditions:

  • CIDR block types are determined by the IP address family. A prefix list cannot contain IPv4 and IPv6 CIDR blocks at the same time.
  • CIDR blocks must be unique within entries in a prefix list. For example, you cannot specify 192.168.1.0/24 twice within the entries in a prefix list.
  • If you specify an IP address, the system converts the IP address to a CIDR block. For example, if you specify 192.168.1.100, the system converts it to 192.168.1.100/32.
  • If you use an IPv6 CIDR block, the system converts it to the zero compression format and changes uppercase letters to lowercase letters. For example, if you specify 2001:0DB8:0000:0000:0000:0000:0000:0000/32, the system converts it to 2001:db8::/32. For more information about CIDR blocks, see What is CIDR?

By default, this property is empty.

Note The total number of entries cannot exceed the value of the MaxEntries property.

Response parameters

Fn::GetAtt

PrefixListId: the ID of the prefix list.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "MaxEntries": {
      "Type": "Number",
      "Description": "The maximum number of entries that the prefix list can contain. Valid values: 1 to 200.",
      "MinValue": 1,
      "MaxValue": 200,
      "Default": 1
    },
    "PrefixListName": {
      "Type": "String",
      "Description": "The name of the prefix. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http://, https://, com.aliyun, or com.alibabacloud. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).",
      "Default": "PrefixListNameSample"
    },
    "Entries": {
      "Type": "Json",
      "Default": [{
        "Cidr": "192.168.1.0/24"
      }],
      "MaxLength": 200
    },
    "AddressFamily": {
      "Type": "String",
      "Description": "The IP address family. Valid values: IPv4 IPv6",
      "AllowedValues": [
        "Ipv4",
        "Ipv6"
      ],
      "Default": "Ipv4"
    }
  },
  "Resources": {
    "PrefixList": {
      "Type": "ALIYUN::ECS::PrefixList",
      "Properties": {
        "MaxEntries": {
          "Ref": "MaxEntries"
        },
        "PrefixListName": {
          "Ref": "PrefixListName"
        },
        "Entries": {
          "Ref": "Entries"
        },
        "AddressFamily": {
          "Ref": "AddressFamily"
        }
      }
    }
  },
  "Outputs": {
    "PrefixListId": {
      "Description": "The ID of the prefix list.",
      "Value": {
        "Fn::GetAtt": [
          "PrefixList",
          "PrefixListId"
        ]
      }
    }
  }
}