Skip to content

Commit a7a480e

Browse files
committed
Adds documentation for aws_vpc
1 parent 3687d15 commit a7a480e

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
subcategory: "VPC (Virtual Private Cloud)"
3+
layout: "aws"
4+
page_title: "AWS: aws_vpc"
5+
description: |-
6+
Lists VPC resources.
7+
---
8+
9+
# List Resource: aws_vpc
10+
11+
Lists VPC resources.
12+
13+
Note: The default VPC is not included.
14+
15+
## Example Usage
16+
17+
### Basic Usage
18+
19+
```terraform
20+
list "aws_vpc" "example" {
21+
provider = aws
22+
}
23+
```
24+
25+
### Filter Usage
26+
27+
This example will return VPCs with the tag `Project` with the value `example`.
28+
29+
```terraform
30+
list "aws_instance" "example" {
31+
provider = aws
32+
33+
config {
34+
filter {
35+
name = "tag:Project"
36+
values = ["example"]
37+
}
38+
}
39+
}
40+
```
41+
42+
## Argument Reference
43+
44+
This list resource supports the following arguments:
45+
46+
* `filter` - (Optional) One or more filters to apply to the search.
47+
If multiple `filter` blocks are provided, they all must be true.
48+
For a full reference of filter names, see [describe-vpcs in the AWS CLI reference][describe-vpcs].
49+
See [`filter` Block](#filter-block) below.
50+
* `region` - (Optional) [Region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints) to query.
51+
Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference).
52+
* `vpc_ids` - (Optional) List of VPC IDs to query.
53+
54+
### `filter` Block
55+
56+
The `filter` block supports the following arguments:
57+
58+
* `name` - (Required) Name of the filter.
59+
For a full reference of filter names, see [describe-vpcs in the AWS CLI reference][describe-vpcs].
60+
`is-default` is not supported.
61+
* `values` - (Required) One or more values to match.
62+
63+
[describe-vpcs]: http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpcs.html

0 commit comments

Comments
 (0)