This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html). # 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 CloudFormation template, use the following syntax: ### JSON ``` { "Type" : "AWS::EC2::PrefixList", "Properties" : { "[AddressFamily](#cfn-ec2-prefixlist-addressfamily)" : {{String}}, "[Entries](#cfn-ec2-prefixlist-entries)" : {{[ Entry, ... ]}}, "[MaxEntries](#cfn-ec2-prefixlist-maxentries)" : {{Integer}}, "[PrefixListName](#cfn-ec2-prefixlist-prefixlistname)" : {{String}}, "[Tags](#cfn-ec2-prefixlist-tags)" : {{[ Tag, ... ]}} } } ``` ### YAML ``` Type: AWS::EC2::PrefixList Properties: [AddressFamily](#cfn-ec2-prefixlist-addressfamily): {{String}} [Entries](#cfn-ec2-prefixlist-entries): {{ - Entry}} [MaxEntries](#cfn-ec2-prefixlist-maxentries): {{Integer}} [PrefixListName](#cfn-ec2-prefixlist-prefixlistname): {{String}} [Tags](#cfn-ec2-prefixlist-tags): {{ - Tag}} ``` ## Properties `AddressFamily` The IP address type. Valid Values: `IPv4` \| `IPv6` *Required*: Yes *Type*: String *Allowed values*: `IPv4 | IPv6` *Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) `Entries` The entries for the prefix list. *Required*: No *Type*: Array of [Entry](aws-properties-ec2-prefixlist-entry.md) *Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) `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. The maximum number of entries per prefix list defaults to 1,000 and can be increased by opening a support case with AWS Support. This property is required when you create a prefix list. *Default Maximum*: `1000` *Required*: Conditional *Type*: Integer *Minimum*: `1` *Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) `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*: `1` *Maximum*: `255` *Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) `Tags` The tags for the prefix list. *Required*: No *Type*: Array of [Tag](aws-properties-ec2-prefixlist-tag.md) *Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) ## 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 [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html). ### 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 [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html). #### `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" ```