github.com/ves/terraform@v0.8.0-beta2/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 ``` 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 resource "aws_network_acl_rule" "private_s3" { 35 network_acl_id = "${aws_network_acl.bar.id}" 36 rule_number = 200 37 egress = false 38 protocol = "tcp" 39 rule_action = "allow" 40 cidr_block = "${data.aws_prefix_list.private_s3.cidr_blocks[0]}" 41 from_port = 443 42 to_port = 443 43 } 44 ``` 45 46 ## Argument Reference 47 48 The arguments of this data source act as filters for querying the available 49 prefix lists. The given filters must match exactly one prefix list 50 whose data will be exported as attributes. 51 52 * `prefix_list_id` - (Required) The ID of the prefix list to select. 53 54 ## Attributes Reference 55 56 The following attributes are exported: 57 58 * `id` - The ID of the selected prefix list. 59 60 * `name` - The name of the selected prefix list. 61 62 * `cidr_blocks` - The list of CIDR blocks for the AWS service associated 63 with the prefix list.