github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/aws/d/prefix_list.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_prefix-list" 4 sidebar_current: "docs-aws-datasource-prefix-list" 5 description: |- 6 Provides details about a specific prefix list 7 --- 8 9 # aws\_prefix\_list 10 11 `aws_prefix_list` provides details about a specific prefix list (PL) 12 in the current region. 13 14 This can be used both to validate a prefix list given in a variable 15 and to obtain the CIDR blocks (IP address ranges) for the associated 16 AWS service. The latter may be useful e.g. for adding network ACL 17 rules. 18 19 ## Example Usage 20 21 ```hcl 22 resource "aws_vpc_endpoint" "private_s3" { 23 vpc_id = "${aws_vpc.foo.id}" 24 service_name = "com.amazonaws.us-west-2.s3" 25 } 26 27 data "aws_prefix_list" "private_s3" { 28 prefix_list_id = "${aws_vpc_endpoint.private_s3.prefix_list_id}" 29 } 30 31 resource "aws_network_acl" "bar" { 32 vpc_id = "${aws_vpc.foo.id}" 33 } 34 35 resource "aws_network_acl_rule" "private_s3" { 36 network_acl_id = "${aws_network_acl.bar.id}" 37 rule_number = 200 38 egress = false 39 protocol = "tcp" 40 rule_action = "allow" 41 cidr_block = "${data.aws_prefix_list.private_s3.cidr_blocks[0]}" 42 from_port = 443 43 to_port = 443 44 } 45 ``` 46 47 ## Argument Reference 48 49 The arguments of this data source act as filters for querying the available 50 prefix lists. The given filters must match exactly one prefix list 51 whose data will be exported as attributes. 52 53 * `prefix_list_id` - (Optional) The ID of the prefix list to select. 54 55 * `name` - (Optional) The name of the prefix list to select. 56 57 ## Attributes Reference 58 59 The following attributes are exported: 60 61 * `id` - The ID of the selected prefix list. 62 63 * `name` - The name of the selected prefix list. 64 65 * `cidr_blocks` - The list of CIDR blocks for the AWS service associated 66 with the prefix list.