AWS::EC2::PrefixList - AWS CloudFormation

AWS::EC2::PrefixList

Specifies a managed prefix list. You can add one or more entries to the prefix list. Each entry consists of a CIDR block and an optional description.

You must specify the maximum number of entries for the prefix list. The maximum number of entries cannot be changed later.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::EC2::PrefixList", "Properties" : { "AddressFamily" : String, "Entries" : [ Entry, ... ], "MaxEntries" : Integer, "PrefixListName" : String, "Tags" : [ Tag, ... ] } }

YAML

Type: AWS::EC2::PrefixList Properties: AddressFamily: String Entries: - Entry MaxEntries: Integer PrefixListName: String Tags: - Tag

Properties

AddressFamily

The IP address type.

Valid Values: IPv4 | IPv6

Required: Yes

Type: String

Update requires: No interruption

Entries

One or more entries for the prefix list.

Required: No

Type: List of Entry

Maximum: 100

Update requires: No interruption

MaxEntries

The maximum number of entries for the prefix list.

Required: Yes

Type: Integer

Update requires: Updates are not supported.

PrefixListName

A name for the prefix list.

Constraints: Up to 255 characters in length. The name cannot start with com.amazonaws.

Required: Yes

Type: String

Update requires: No interruption

Tags

The tags for the prefix list.

Required: No

Type: List of Tag

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the ID of the prefix list.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

The ARN of the prefix list. For example, arn:aws:ec2:us-east-1:123456789012:prefix-list/pl-0123123123123abcd.

OwnerId

The ID of the owner of the prefix list. For example, 123456789012.

PrefixListId

The ID of the prefix list. For example, pl-0123123123123abcd.

Version

The version of the prefix list. For example, 1.

Examples

Creating a prefix list

The following example creates an IPv4 prefix list with a maximum of 10 entries, and creates 2 entries in the prefix list.

JSON

{ "Resources": { "NewPrefixList": { "Type": "AWS::EC2::PrefixList", "Properties": { "PrefixListName": "vpc-1-servers", "AddressFamily": "IPv4", "MaxEntries": 10, "Entries": [ { "Cidr": "10.0.0.5/32", "Description": "Server 1" }, { "Cidr": "10.0.0.10/32", "Description": "Server 2" } ], "Tags": [ { "Key": "Name", "Value": "VPC-1-Servers" } ] } } } }

YAML

Resources: NewPrefixList: Type: AWS::EC2::PrefixList Properties: PrefixListName: "vpc-1-servers" AddressFamily: "IPv4" MaxEntries: 10 Entries: - Cidr: "10.0.0.5/32" Description: "Server 1" - Cidr: "10.0.0.10/32" Description: "Server 2" Tags: - Key: "Name" Value: "VPC-1-Servers"