Skip to content
This repository was archived by the owner on May 1, 2023. It is now read-only.

Commit 257da75

Browse files
committed
docs: update README
1 parent e031f8a commit 257da75

File tree

1 file changed

+63
-19
lines changed

1 file changed

+63
-19
lines changed

README.md

Lines changed: 63 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,77 @@
1+
## Purpose
2+
3+
This module is considered to be a [data-only](https://www.terraform.io/docs/language/modules/develop/composition.html#data-only-modules) module. Given the name of a VPC and an optional set of availability zones, this module returns information about a VPC, such as public and private subnets, the VPC ID, etc. See the [outputs](outputs.tf) file for which data is returned from this module. This module is useful for workspaces that require such information without declaring repetitive `data` sources in your Terraform configurations.
4+
5+
## Usage
6+
7+
The following example creates a security group and an application load balancer.
8+
9+
```hcl
10+
provider "aws" {}
11+
12+
module "networking" {
13+
source = "api.env0.com/0d3fca0b-57fe-4d36-9132-cf4949639403/networking-readonly/aws"
14+
version = "v1.0.0"
15+
16+
vpc_name = "tutorial-vpc"
17+
}
18+
19+
resource "aws_security_group" "this" {
20+
ingress = [
21+
{
22+
cidr_blocks = ["0.0.0.0/0"]
23+
from_port = 443
24+
protocol = "TCP"
25+
to_port = 443
26+
}
27+
]
28+
29+
vpc_id = module.networking.vpc_id
30+
}
31+
32+
resource "aws_lb" "this" {
33+
internal = false
34+
load_balancer_type = "application"
35+
security_groups = [aws_security_group.this.id]
36+
subnets = module.networking.public_subnets
37+
}
38+
```
39+
140
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
41+
242
## Requirements
343

4-
| Name | Version |
5-
|------|---------|
6-
| aws | ~> 3.64.2 |
44+
| Name | Version |
45+
| ---- | --------- |
46+
| aws | ~> 3.64.2 |
747

848
## Providers
949

10-
| Name | Version |
11-
|------|---------|
12-
| aws | ~> 3.64.2 |
50+
| Name | Version |
51+
| ---- | --------- |
52+
| aws | ~> 3.64.2 |
1353

1454
## Inputs
1555

16-
| Name | Description | Type | Default | Required |
17-
|------|-------------|------|---------|:--------:|
18-
| availability\_zones | Select subnets only in the given AZs | `set(string)` | `[]` | no |
19-
| vpc\_name | The name of the VPC | `string` | n/a | yes |
56+
| Name | Description | Type | Default | Required |
57+
| ------------------ | ------------------------------------ | ------------- | ------- | :------: |
58+
| availability_zones | Select subnets only in the given AZs | `set(string)` | `[]` | no |
59+
| vpc_name | The name of the VPC | `string` | n/a | yes |
2060

2161
## Outputs
2262

23-
| Name | Description |
24-
|------|-------------|
25-
| dns\_hostnames\_enabled | Indicates if instances launched in this VPC will have public DNS hostnames |
26-
| dns\_support\_enabled | Indicates if DNS support is enabled for this VPC |
27-
| private\_subnets | List of private subnets in this VPC |
28-
| public\_subnets | List of public subnets in this VPC |
29-
| vpc\_arn | Arn of this VPC |
30-
| vpc\_cidr\_block | CIDR range for this VPC |
31-
| vpc\_id | The ID of the VPC |
63+
| Name | Description |
64+
| --------------------- | -------------------------------------------------------------------------- |
65+
| dns_hostnames_enabled | Indicates if instances launched in this VPC will have public DNS hostnames |
66+
| dns_support_enabled | Indicates if DNS support is enabled for this VPC |
67+
| private_subnets | List of private subnets in this VPC |
68+
| public_subnets | List of public subnets in this VPC |
69+
| vpc_arn | Arn of this VPC |
70+
| vpc_cidr_block | CIDR range for this VPC |
71+
| vpc_id | The ID of the VPC |
3272

3373
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
74+
75+
## License
76+
77+
[MIT License](LICENSE)

0 commit comments

Comments
 (0)