ALIYUN::ECS::PrefixList

更新时间:
复制 MD 格式

ALIYUN::ECS::PrefixList creates 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

Maximum number of entries in the prefix list.

Valid values: 1 to 200.

Description

String

No

Yes

Description of the prefix list.

2–256 characters. Cannot start with http:// or https://. Empty by default.

PrefixListName

String

Yes

Yes

Name of the prefix list.

2–128 characters. Must start with a letter. Cannot start with http://, https://, com.aliyun, or com.alibabacloud. Can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

Entries

List

No

Yes

Entries in the prefix list.

You can specify up to 200 entries.

For more information, see Entries properties.

AddressFamily

String

Yes

No

IP address family for 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

Description of the entry.

2–32 characters. Can contain letters. Cannot start with http:// or https://.

Cidr

String

Yes

No

CIDR block in the entry.

The CIDR block must meet the following conditions:

  • CIDR block type depends on the IP address family. A prefix list cannot mix IPv4 and IPv6 blocks.

  • CIDR blocks must be unique within a prefix list. For example, you cannot specify 192.168.1.0/24 twice.

  • If you specify an IP address, the system converts it to a CIDR block. For example, 192.168.1.100 becomes 192.168.1.100/32.

  • For IPv6, the system applies zero compression and converts to lowercase. For example, 2001:0DB8:0000:0000:0000:0000:0000:0000/32 becomes 2001:db8::/32. What is CIDR?

Empty by default.

Note

The number of entries cannot exceed MaxEntries.

Return values

Fn::GetAtt

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