Use the aws_prefix_list_entry
resource to manage a managed prefix list entry.
Basic usage.
resource "aws_ec2_managed_prefix_list" "example" {
name = "All VPC CIDR-s"
address_family = "IPv4"
max_entries = 5
tags = {
Env = "live"
}
}
resource "aws_ec2_managed_prefix_list_entry" "entry_1" {
cidr = aws_vpc.example.cidr_block
description = "Primary"
prefix_list_id = aws_ec2_managed_prefix_list.example.id
}
This resource supports the following arguments:
cidr
- (Required) CIDR block of this entry.description
- (Optional) Description of this entry. Please note that due to API limitations, updating only the description of an entry will require recreating the entry.prefix_list_id
- (Required) The ID of the prefix list.This resource exports the following attributes in addition to the arguments above:
id
- ID of the managed prefix list entry.In Terraform v1.5.0 and later, use an import
block to import prefix list entries using prefix_list_id
and cidr
separated by a comma (,
). For example:
import {
to = aws_ec2_managed_prefix_list_entry.default
id = "pl-0570a1d2d725c16be,10.0.3.0/24"
}
Using terraform import
, import prefix list entries using prefix_list_id
and cidr
separated by a comma (,
). For example:
% terraform import aws_ec2_managed_prefix_list_entry.default pl-0570a1d2d725c16be,10.0.3.0/24