You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+170-1Lines changed: 170 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,12 +42,181 @@ module "vpc" {
42
42
}
43
43
```
44
44
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:
0 commit comments