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
Refer [examples](https://gitlab.com/squareops/sal/terraform/aws/network/-/tree/qa/examples) directory for more references.
54
+
Refer [examples](examples) for all examples.
55
+
22
56
## Important Note
23
-
To prevent destruction interruptions, any extra LBs or resources that have been created outside of Terraform and attached to the Terraform resources must be deleted before the module is destroyed.
57
+
To prevent destruction interruptions, any resources that have been created outside of Terraform and attached to the resources provisioned by Terraform must be deleted before the module is destroyed.
24
58
25
59
## Network Scenarios
26
60
27
-
Users need to provide`vpc_cidr` and subnets are calculated with the help of [in-built functions](https://gitlab.com/squareops/sal/terraform/aws/network/-/blob/qa/main.tf#L2).
61
+
Users need to declare`vpc_cidr` and subnets are calculated with the help of in-built functions.
28
62
29
-
This module supports three scenarios for creating Network resource on AWS. Each will be explained in detail in the corresponding sections.
63
+
This module supports three scenarios to create Network resource on AWS. Each will be explained in brief in the corresponding sections.
30
64
31
-
-**simple-vpc (default behavior):**For creating a VPC with only public subnets and IGW.
65
+
-**simple-vpc (default behavior):**To create a VPC with public subnets and IGW.
32
66
-`vpc_cidr = ""`
33
67
-`enable_public_subnet = true`
34
-
-**vpc-with-private-sub:**For creating a VPC with both public and private subnets and IGW and NAT gateway.
68
+
-**vpc-with-private-sub:**To create a VPC with public subnets, private subnets, IGW gateway and NAT gateway.
35
69
-`vpc_cidr = local.vpc_cidr`
36
70
-`enable_public_subnet = true`
37
71
-`enable_private_subnet = true`
38
72
39
-
-**complete-vpc-with-vpn:**For creating a VPC with public, private, database and intra subnets along with an IGW and NAT gateway. Jump server/Bastion Host is also configured.
73
+
-**complete-vpc-with-vpn:**To create a VPC with public, private, database and intra subnets along with an IGW and NAT gateway. Jump server/Bastion Host is also configured.
40
74
-`vpc_cidr = local.vpc_cidr`
41
75
-`enable_public_subnet = true`
42
76
-`enable_private_subnet = true`
@@ -50,6 +84,12 @@ This module supports three scenarios for creating Network resource on AWS. Each
The required IAM permissions to create resources from this module can be found [here](https://github.com/squareops/terraform-aws-network/blob/main/IAM.md)
90
+
91
+
92
+
53
93
# VPN setup-
54
94
55
95
To configure Pritunl VPN:
@@ -83,73 +123,6 @@ server administration ports (Automated)
| <aname="input_azs"></a> [azs](#input\_azs)| List of Availability Zone to be used by VPC |`list(any)`| n/a | yes |
118
-
| <aname="input_database_subnet_cidrs"></a> [database\_subnet\_cidrs](#input\_database\_subnet\_cidrs)| Database Tier subnet CIDRs to be created |`list(any)`|`[]`| no |
119
-
| <aname="input_default_network_acl_ingress"></a> [default\_network\_acl\_ingress](#input\_default\_network\_acl\_ingress)| List of maps of ingress rules to set on the Default Network ACL |`list(map(string))`| <pre>[<br> {<br> "action": "deny",<br> "cidr_block": "0.0.0.0/0",<br> "from_port": 22,<br> "protocol": "tcp",<br> "rule_no": 98,<br> "to_port": 22<br> },<br> {<br> "action": "deny",<br> "cidr_block": "0.0.0.0/0",<br> "from_port": 3389,<br> "protocol": "tcp",<br> "rule_no": 99,<br> "to_port": 3389<br> },<br> {<br> "action": "allow",<br> "cidr_block": "0.0.0.0/0",<br> "from_port": 0,<br> "protocol": "-1",<br> "rule_no": 100,<br> "to_port": 0<br> },<br> {<br> "action": "allow",<br> "from_port": 0,<br> "ipv6_cidr_block": "::/0",<br> "protocol": "-1",<br> "rule_no": 101,<br> "to_port": 0<br> }<br>]</pre> | no |
120
-
| <aname="input_enable_database_subnet"></a> [enable\_database\_subnet](#input\_enable\_database\_subnet)| Set true to enable database subnets |`bool`|`false`| no |
121
-
| <aname="input_enable_flow_log"></a> [enable\_flow\_log](#input\_enable\_flow\_log)| Whether or not to enable VPC Flow Logs |`bool`|`false`| no |
122
-
| <aname="input_enable_intra_subnet"></a> [enable\_intra\_subnet](#input\_enable\_intra\_subnet)| Set true to enable intra subnets |`bool`|`false`| no |
123
-
| <aname="input_enable_private_subnet"></a> [enable\_private\_subnet](#input\_enable\_private\_subnet)| Set true to enable private subnets |`bool`|`false`| no |
124
-
| <aname="input_enable_public_subnet"></a> [enable\_public\_subnet](#input\_enable\_public\_subnet)| Set true to enable public subnets |`bool`|`false`| no |
125
-
| <aname="input_environment"></a> [environment](#input\_environment)| Specify the environment indentifier for the VPC |`string`| n/a | yes |
126
-
| <aname="input_flow_log_cloudwatch_log_group_retention_in_days"></a> [flow\_log\_cloudwatch\_log\_group\_retention\_in\_days](#input\_flow\_log\_cloudwatch\_log\_group\_retention\_in\_days)| Specifies the number of days you want to retain log events in the specified log group for VPC flow logs. |`number`|`null`| no |
127
-
| <aname="input_flow_log_max_aggregation_interval"></a> [flow\_log\_max\_aggregation\_interval](#input\_flow\_log\_max\_aggregation\_interval)| The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. Valid Values: `60` seconds or `600` seconds. |`number`|`60`| no |
128
-
| <aname="input_intra_subnet_cidrs"></a> [intra\_subnet\_cidrs](#input\_intra\_subnet\_cidrs)| A list of intra subnets CIDR to be created |`list(any)`|`[]`| no |
129
-
| <aname="input_name"></a> [name](#input\_name)| Specify the name of the VPC |`string`| n/a | yes |
130
-
| <aname="input_one_nat_gateway_per_az"></a> [one\_nat\_gateway\_per\_az](#input\_one\_nat\_gateway\_per\_az)| Set to true if a NAT Gateway is required per availability zone for Private Subnet Tier |`bool`|`false`| no |
131
-
| <aname="input_private_subnet_cidrs"></a> [private\_subnet\_cidrs](#input\_private\_subnet\_cidrs)| A list of private subnets CIDR to be created inside the VPC |`list(any)`|`[]`| no |
132
-
| <aname="input_public_subnet_cidrs"></a> [public\_subnet\_cidrs](#input\_public\_subnet\_cidrs)| A list of public subnets CIDR to be created inside the VPC |`list(any)`|`[]`| no |
133
-
| <aname="input_region"></a> [region](#input\_region)| Specify the region in which VPC will be created |`string`|`"us-east-1"`| no |
134
-
| <aname="input_vpc_cidr"></a> [vpc\_cidr](#input\_vpc\_cidr)| The CIDR block of the VPC |`string`|`"10.0.0.0/16"`| no |
135
-
| <aname="input_vpn_key_pair"></a> [vpn\_key\_pair](#input\_vpn\_key\_pair)| Specify the name of AWS Keypair to be used for VPN Server |`string`|`""`| no |
136
-
| <aname="input_vpn_server_enabled"></a> [vpn\_server\_enabled](#input\_vpn\_server\_enabled)| Set to true if you want to deploy VPN Gateway resource and attach it to the VPC |`bool`|`false`| no |
137
-
| <aname="input_vpn_server_instance_type"></a> [vpn\_server\_instance\_type](#input\_vpn\_server\_instance\_type)| EC2 instance Type for VPN Server, Only amd64 based instance type are supported eg. t2.medium, t3.micro, c5a.large etc. |`string`|`"t3a.small"`| no |
138
-
139
-
## Outputs
140
-
141
-
| Name | Description |
142
-
|------|-------------|
143
-
| <aname="output_database_subnets"></a> [database\_subnets](#output\_database\_subnets)| List of IDs of database subnets |
144
-
| <aname="output_intra_subnets"></a> [intra\_subnets](#output\_intra\_subnets)| Intra Subnet IDs |
145
-
| <aname="output_private_subnets"></a> [private\_subnets](#output\_private\_subnets)| List of IDs of private subnets |
146
-
| <aname="output_public_subnets"></a> [public\_subnets](#output\_public\_subnets)| List of IDs of public subnets |
147
-
| <aname="output_region"></a> [region](#output\_region)| AWS Region for the VPC |
148
-
| <aname="output_vpc_cidr_block"></a> [vpc\_cidr\_block](#output\_vpc\_cidr\_block)| IPV4 CIDR Block for this VPC |
149
-
| <aname="output_vpc_id"></a> [vpc\_id](#output\_vpc\_id)| The ID of the VPC |
150
-
| <aname="output_vpn_host_public_ip"></a> [vpn\_host\_public\_ip](#output\_vpn\_host\_public\_ip)| IP Address of VPN Server |
151
-
| <aname="output_vpn_security_group"></a> [vpn\_security\_group](#output\_vpn\_security\_group)| Security Group ID of VPN Server |
152
-
<!-- END_TF_DOCS -->
153
126
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
154
127
## Requirements
155
128
@@ -217,3 +190,6 @@ server administration ports (Automated)
217
190
| <aname="output_vpn_host_public_ip"></a> [vpn\_host\_public\_ip](#output\_vpn\_host\_public\_ip)| IP Address of VPN Server |
218
191
| <aname="output_vpn_security_group"></a> [vpn\_security\_group](#output\_vpn\_security\_group)| Security Group ID of VPN Server |
Copy file name to clipboardExpand all lines: examples/complete-vpc-with-vpn/README.md
+21-1Lines changed: 21 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,22 @@
1
-
# complete-vpc-with-vpn
1
+
# Complete VPC with VPN
2
+
3
+
This configuration is suitable for production environments
4
+
5
+
A NAT Gateway, Public and Private subnet will be created per availability zone.
6
+
7
+
8
+
## Usage
9
+
10
+
To run this example you need to execute:
11
+
12
+
```bash
13
+
$ terraform init
14
+
$ terraform plan
15
+
$ terraform apply
16
+
```
17
+
18
+
Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources.
19
+
2
20
3
21
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4
22
## Requirements
@@ -43,3 +61,5 @@ No inputs.
43
61
| <aname="output_vpn_host_public_ip"></a> [vpn\_host\_public\_ip](#output\_vpn\_host\_public\_ip)| IP Adress of VPN Server |
44
62
| <aname="output_vpn_security_group"></a> [vpn\_security\_group](#output\_vpn\_security\_group)| Security Group ID of VPN Server |
Copy file name to clipboardExpand all lines: examples/simple-vpc/README.md
-36Lines changed: 0 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -18,42 +18,6 @@ $ terraform apply
18
18
19
19
Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources.
Copy file name to clipboardExpand all lines: examples/vpc-with-private-sub/README.md
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,20 @@
1
-
# vpc-with-private-sub
1
+
# VPC with Private Subnets
2
+
3
+
4
+
A public and private subnet will be created per availability zone in addition to single NAT Gateway shared between all availability zones.
5
+
6
+
## Usage
7
+
8
+
To run this example you need to execute:
9
+
10
+
```bash
11
+
$ terraform init
12
+
$ terraform plan
13
+
$ terraform apply
14
+
```
15
+
16
+
Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources.
17
+
2
18
3
19
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
0 commit comments