Skip to content

Commit b61bfef

Browse files
committed
docs: updating the readme with some examples
1 parent 084b052 commit b61bfef

File tree

1 file changed

+170
-1
lines changed

1 file changed

+170
-1
lines changed

README.md

Lines changed: 170 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,181 @@ module "vpc" {
4242
}
4343
```
4444

45+
### Enabling NAT Gateways
46+
47+
To enable NAT gateways in your VPC, you can use the `enable_nat_gateway` and `nat_gateway_mode` variables. Here are some examples:
48+
49+
```hcl
50+
# Single NAT Gateway for all AZs
51+
module "vpc" {
52+
source = "appvia/network/aws"
53+
version = "0.0.8"
54+
55+
enable_nat_gateway = true
56+
nat_gateway_mode = "single"
57+
# ... other configuration ...
58+
}
59+
60+
# One NAT Gateway per AZ for high availability
61+
module "vpc" {
62+
source = "appvia/network/aws"
63+
version = "0.0.8"
64+
65+
enable_nat_gateway = true
66+
nat_gateway_mode = "one_per_az"
67+
# ... other configuration ...
68+
}
69+
```
70+
71+
Remember that NAT gateways incur costs, so choose the configuration that best balances your availability requirements and budget.
72+
73+
### Using Transit Gateway
74+
75+
The module supports connecting your VPC to an AWS Transit Gateway. Here are some common configurations:
76+
77+
```hcl
78+
# Basic Transit Gateway connection
79+
module "vpc" {
80+
source = "appvia/network/aws"
81+
version = "0.0.8"
82+
83+
enable_transit_gateway = true
84+
transit_gateway_id = "tgw-1234567890abcdef0" # Your Transit Gateway ID
85+
86+
# Default route to Transit Gateway for private subnets
87+
transit_gateway_routes = {
88+
private = "10.0.0.0/8" # Route all 10.0.0.0/8 traffic to Transit Gateway
89+
}
90+
# ... other configuration ...
91+
}
92+
93+
# Transit Gateway with appliance mode (for network appliances)
94+
module "vpc" {
95+
source = "appvia/network/aws"
96+
version = "0.0.8"
97+
98+
enable_transit_gateway = true
99+
enable_transit_gateway_appliance_mode = true
100+
transit_gateway_id = "tgw-1234567890abcdef0"
101+
102+
# Using a prefix list for routes
103+
transit_gateway_routes = {
104+
private = "pl-1234567890abcdef0" # AWS prefix list ID
105+
}
106+
# ... other configuration ...
107+
}
108+
```
109+
110+
The Transit Gateway configuration supports:
111+
112+
- Connecting to an existing Transit Gateway
113+
- Appliance mode for network appliance deployments
114+
- Custom routing using CIDR blocks or prefix lists
115+
- Optional NAT Gateway access for Transit Gateway subnets
116+
117+
### Using Private Endpoints
118+
119+
The module supports creating VPC endpoints for AWS services. Here are some common configurations:
120+
121+
```hcl
122+
# Enable SSM endpoints (Session Manager)
123+
module "vpc" {
124+
source = "appvia/network/aws"
125+
version = "0.0.8"
126+
127+
enable_ssm = true
128+
# ... other configuration ...
129+
}
130+
131+
# Enable specific private endpoints
132+
module "vpc" {
133+
source = "appvia/network/aws"
134+
version = "0.0.8"
135+
136+
enable_private_endpoints = [
137+
"ecr.api",
138+
"ecr.dkr",
139+
"s3",
140+
"logs"
141+
]
142+
# ... other configuration ...
143+
}
144+
```
145+
146+
You can use `enable_ssm` as a shortcut to enable the SSM endpoints.
147+
148+
```hcl
149+
module "vpc" {
150+
source = "appvia/network/aws"
151+
version = "0.0.8"
152+
153+
enable_ssm = true
154+
}
155+
```
156+
157+
## Using Route53 Resolver Rules
158+
159+
The module supports automatically associating shared Route53 Resolver Rules with your VPC. By default, any resolver rules shared with your account will be automatically associated. Here are some configuration examples:
160+
161+
```hcl
162+
# Disable automatic resolver rule association
163+
module "vpc" {
164+
source = "appvia/network/aws"
165+
version = "0.0.8"
166+
167+
enable_route53_resolver_rules = false
168+
# ... other configuration ...
169+
}
170+
171+
# Exclude specific resolver rules from association
172+
module "vpc" {
173+
source = "appvia/network/aws"
174+
version = "0.0.8"
175+
176+
enable_route53_resolver_rules = true
177+
exclude_route53_resolver_rules = ["rslvr-rr-1234567890abcdef0"] # Resolver Rule IDs to exclude
178+
# ... other configuration ...
179+
}
180+
```
181+
182+
By default (`enable_route53_resolver_rules = true`), the module will:
183+
184+
- Automatically discover all resolver rules shared with your account
185+
- Associate them with the VPC being created
186+
- Allow you to exclude specific rules using the `exclude_route53_resolver_rules` variable
187+
188+
## Adding Additional Subnets
189+
190+
To add more subnets to your VPC, you can extend the subnet configurations in your Terraform code. Here are some examples:
191+
192+
### Adding Public Subnets
193+
194+
```hcl
195+
module "vpc" {
196+
additional_subnets = {
197+
public = {
198+
cidr_blocks = ["10.0.10.0/24", "10.0.11.0/24", "10.0.12.0/24"]
199+
tags = {
200+
Name = "public-subnets"
201+
}
202+
}
203+
}
204+
}
205+
```
206+
207+
Remember to:
208+
209+
1. Ensure CIDR blocks don't overlap
210+
2. Consider your IP address space requirements
211+
3. Follow your organization's IP addressing scheme
212+
4. Update route tables and network ACLs accordingly
213+
45214
## Update Documentation
46215

47216
The `terraform-docs` utility is used to generate this README. Follow the below steps to update:
48217

49218
1. Make changes to the `.terraform-docs.yml` file
50-
2. Fetch the `terraform-docs` binary (https://terraform-docs.io/user-guide/installation/)
219+
2. Fetch the `terraform-docs` binary (<https://terraform-docs.io/user-guide/installation/>)
51220
3. Run `terraform-docs markdown table --output-file ${PWD}/README.md --output-mode inject .`
52221

53222
<!-- BEGIN_TF_DOCS -->

0 commit comments

Comments
 (0)