This is the new AWS CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.
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.
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:StringEntries:- EntryMaxEntries:IntegerPrefixListName:StringTags:- Tag
Properties
AddressFamily-
The IP address type.
Valid Values:
IPv4|IPv6Required: Yes
Type: String
Allowed values:
IPv4 | IPv6Update requires: No interruption
Entries-
The entries for the prefix list.
Required: No
Type: Array of Entry
Minimum:
0Maximum:
100Update requires: No interruption
MaxEntries-
The maximum number of entries for the prefix list. You can't modify the entries and the size of a prefix list at the same time.
This property is required when you create a prefix list.
Required: Conditional
Type: Integer
Minimum:
1Update requires: No interruption
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
Minimum:
1Maximum:
255Update requires: No interruption
-
The tags for the prefix list.
Required: No
Type: Array 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
Create 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"