All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::PrefixList

Last Updated:Jan 10, 2025

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 supported 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, and cannot start with http:// or https://. This property is empty by default.

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 and cannot start with http://, https://, com.aliyun, or com.alibabacloud. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

Entries

List

No

Yes

The information about 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 of the entry.

The description must be 2 to 32 characters in length, and can contain letters. It cannot start with http:// or https://.

Cidr

String

Yes

No

The CIDR block in the entry.

The CIDR block must meet the following conditions:

  • The CIDR block type varies based on the IP address family. A prefix list cannot contain both IPv4 and IPv6 CIDR blocks.

  • CIDR blocks must be unique within the 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 into a CIDR block. For example, if you specify 192.168.1.100, the system converts it into 192.168.1.100/32.

  • If you use an IPv6 CIDR block, the system converts it into a value in 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 into 2001:db8::/32. For more information about CIDR blocks, see What is CIDR?

This property is empty by default.

Note

The number of entries in the prefix list cannot exceed the value of MaxEntries.

Return values

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