Skip to content

Commit 0f3b3bf

Browse files
committed
Update README.md, modules/vpn/README.md
1 parent b12d271 commit 0f3b3bf

File tree

2 files changed

+37
-49
lines changed

2 files changed

+37
-49
lines changed

README.md

Lines changed: 36 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,65 +18,53 @@ module "vpc" {
1818
}
1919
2020
```
21-
Refer ```examples``` directory for more reference.
21+
Refer [examples](https://gitlab.com/squareops/sal/terraform/aws/network/-/tree/qa/examples) directory for more references.
2222

2323
## Network Scenarios
2424

25+
Users only 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).
26+
2527
This module supports three scenarios for creating Network resource on AWS. Each will be explained in further detail in the corresponding sections.
2628

27-
- **vpc_minimal (default behavior):** For creating a VPC with only public subnets and IGW.
29+
- **simple-vpc (default behavior):** For creating a VPC with only public subnets and IGW.
2830
- `vpc_cidr = ""`
29-
- `public_subnets = []`
30-
- **vpc_secure:** For creating a VPC with both public and private subnets and IGW and NAT gateway. Jump server/Bastion Host is also configured.
31-
- `public_subnets = []`
32-
- `private_subnets = []`
33-
- `enable_nat_gateway = true`
34-
- `single_nat_gateway = true`
35-
- `one_nat_gateway_per_az = false`
36-
- `vpn_host_enabled = true`
37-
- `vpn_host_instance_type = "t3a.small"`
38-
- `enable_flow_log = false`
39-
- `flow_log_max_aggregation_interval = 60`
40-
- `flow_log_cloudwatch_log_group_retention_in_days = 90`
41-
42-
- **vpc_three_tier:** For creating a VPC with public, private and database subnets ( where app and database subnets are private subnets)along with an IGW and NAT gateway. Jump server/Bastion Host is also configured.
43-
- `public_subnets = []`
44-
- `private_subnets = []`
45-
- `database_subnets = []`
46-
- `create_database_subnet_route_table = true`
47-
- `create_database_nat_gateway_route = true`
48-
- `create_cis_vpc = true`
49-
50-
## NAT Gateway Scenarios
51-
52-
This module supports three scenarios for creating NAT gateways. Each will be explained in further detail in the corresponding sections.
53-
54-
- One NAT Gateway per subnet (default behavior)
55-
- `enable_nat_gateway = true`
56-
- `single_nat_gateway = false`
57-
- `one_nat_gateway_per_az = false`
58-
- Single NAT Gateway
59-
- `enable_nat_gateway = true`
60-
- `single_nat_gateway = true`
31+
- `enable_public_subnet = true`
32+
- **vpc-with-private-sub:** For creating a VPC with both public and private subnets and IGW and NAT gateway.
33+
- `vpc_cidr = local.vpc_cidr`
34+
- `enable_public_subnet = true`
35+
- `enable_private_subnet = true`
36+
37+
- **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.
38+
- `vpc_cidr = local.vpc_cidr`
39+
- `enable_public_subnet = true`
40+
- `enable_private_subnet = true`
41+
- `enable_database_subnet = true`
42+
- `enable_intra_subnet = true`
6143
- `one_nat_gateway_per_az = false`
62-
- One NAT Gateway per availability zone
63-
- `enable_nat_gateway = true`
64-
- `single_nat_gateway = false`
65-
- `one_nat_gateway_per_az = true`
66-
67-
If both `single_nat_gateway` and `one_nat_gateway_per_az` are set to `true`, then `single_nat_gateway` takes precedence.
44+
- `vpn_server_enabled = true`
45+
- `vpn_server_instance_type = "t3a.small"`
46+
- `vpn_key_pair = ""`
47+
- `enable_flow_log = true`
48+
- `flow_log_max_aggregation_interval = 60`
49+
- `flow_log_cloudwatch_log_group_retention_in_days = 90`
6850

69-
Make sure whenever you set `one_nat_gateway_per_az` to `true` you should have as many public subnets as we have AZ in the region or else this module will fail cause some `region` has more than 3 AZ like N.Virginia and we bydefault provisoning only 3 public subnets
51+
# VPN setup-
7052

53+
To configure Pritunl VPN:
7154

72-
- To add SSL to the Pritunl endpoint:
73-
74-
1. Create a DNS record mapping to the vpn host public IP
75-
2. Login to pritunl from the credentials in the pritunl-info.txt in the pritunl folder.
76-
3. After login,in the Initial setup window, add the record created in the 'Lets Encrypt Domain' field.
77-
4. Pritunl will automatically configure a signed SSL certificate from Lets Encrypt.
55+
1. Open the public IP of instance.
56+
2. Get the initial key and user, password for setting up Pritunl from Secret Manager and log in to Pritunl.
57+
3. Create a DNS record mapping to the vpn host public IP
58+
4. After login,in the Initial setup window, add the record created in the 'Lets Encrypt Domain' field.
59+
5. Pritunl will automatically configure a signed SSL certificate from Lets Encrypt.
60+
6. Add organization and user to pritunl.
61+
7. Add server port as 10150 which is already allowed from security group while creating vpn.
62+
8. Attach organization to the server and Start the server.
63+
9. Copy or download user profile link or file.
64+
10. Import the profile in Pritunl client.
65+
66+
NOTE: Port 80 to be open publicly in the vpn security group to verify and renewing the domain certificate.
7867

79-
NOTE: Port 80 to be open publicly in the vpn security group to verify and renewing the domain certificate.
8068
# CIS COMPLIANCE
8169

8270
- Follows the VPC recommendations of CIS Amazon Web Services Foundations Benchmark v1.4.0

modules/vpn/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# vpn
1+
# VPN
22

33
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
44
## Requirements

0 commit comments

Comments
 (0)