Skip to content

Commit b12d271

Browse files
committed
update Readme
1 parent fc01d47 commit b12d271

File tree

5 files changed

+25
-32
lines changed

5 files changed

+25
-32
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ repos:
66
- id: terraform-validate
77
- id: tflint
88
args:
9-
- "--module"
10-
- "--deep"
9+
# - "--module"
1110
- "--config=.tflint.hcl"
12-
- repo: https://github.com/squareops/pre-commit-terraform
13-
rev: v1.47.0
11+
- repo: https://github.com/antonbabenko/pre-commit-terraform
12+
rev: v1.74.0
1413
hooks:
1514
- id: terraform_docs
15+
args:
16+
- --hook-config=--add-to-existing-file=true
17+
- --hook-config=--create-file-if-not-exist=true
1618
- repo: https://github.com/pre-commit/pre-commit-hooks
1719
rev: v4.1.0
1820
hooks:

README.md

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
## IAM permission Required to run this module
2-
3-
- AmazonVPCFullAccess
4-
- CloudWatchFullAccess
5-
- AmazonSSMFullAccess
6-
- AmazonEC2FullAccess
7-
- IAMFullAccess
81

92
# AWS Network Terraform module
103

@@ -14,17 +7,19 @@ Terraform module to create Networking resources for workload deployment on AWS C
147

158
```hcl
169
module "vpc" {
17-
source = "git::https://{GIT_USER}:{GIT_TOKEN}@gitlab.com/squareops/sal/terraform/aws/network.git?ref=dev"
18-
19-
environment = var.environment
20-
name = var.name
21-
region = var.region
22-
additional_aws_tags = var.additional_aws_tags
23-
vpc_cidr = var.vpc_cidr
24-
public_subnets = var.public_subnets
10+
source = "git@gitlab.com:squareops/sal/terraform/aws/network.git?ref=qa"
11+
12+
environment = "dev"
13+
name = "skaf"
14+
region = "us-east-1"
15+
vpc_cidr = "10.0.0.0/16"
16+
azs = ["us-east-1a", "us-east-1b"]
17+
enable_public_subnet = true
2518
}
2619
2720
```
21+
Refer ```examples``` directory for more reference.
22+
2823
## Network Scenarios
2924

3025
This module supports three scenarios for creating Network resource on AWS. Each will be explained in further detail in the corresponding sections.
@@ -73,14 +68,13 @@ If both `single_nat_gateway` and `one_nat_gateway_per_az` are set to `true`, the
7368

7469
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
7570

76-
- To create ***CIS compliant VPC*** set the variable ***create_cis_vpc*** to ***true*** in the .tfvars file.
7771

7872
- To add SSL to the Pritunl endpoint:
7973

80-
Create a DNS record mapping to the vpn host public IP.
81-
Login to pritunl from the credentials in the pritunl-info.txt in the pritunl folder.
82-
After login,in the Initial setup window, add the record created in the 'Lets Encrypt Domain' field.
83-
Pritunl will automatically configure a signed SSL certificate from Lets Encrypt.
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.
8478

8579
NOTE: Port 80 to be open publicly in the vpn security group to verify and renewing the domain certificate.
8680
# CIS COMPLIANCE
@@ -130,19 +124,19 @@ server administration ports (Automated)
130124

131125
| Name | Description | Type | Default | Required |
132126
|------|-------------|------|---------|:--------:|
133-
| <a name="input_azs"></a> [azs](#input\_azs) | List of Availability Zone to be used by VPC | `list(any)` | `[]` | no |
127+
| <a name="input_azs"></a> [azs](#input\_azs) | List of Availability Zone to be used by VPC | `list(any)` | n/a | yes |
134128
| <a name="input_database_subnet_cidrs"></a> [database\_subnet\_cidrs](#input\_database\_subnet\_cidrs) | Database Tier subnet CIDRs to be created | `list(any)` | `[]` | no |
135129
| <a name="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 |
136130
| <a name="input_enable_database_subnet"></a> [enable\_database\_subnet](#input\_enable\_database\_subnet) | Set true to enable database subnets | `bool` | `false` | no |
137131
| <a name="input_enable_flow_log"></a> [enable\_flow\_log](#input\_enable\_flow\_log) | Whether or not to enable VPC Flow Logs | `bool` | `false` | no |
138132
| <a name="input_enable_intra_subnet"></a> [enable\_intra\_subnet](#input\_enable\_intra\_subnet) | Set true to enable intra subnets | `bool` | `false` | no |
139133
| <a name="input_enable_private_subnet"></a> [enable\_private\_subnet](#input\_enable\_private\_subnet) | Set true to enable private subnets | `bool` | `false` | no |
140134
| <a name="input_enable_public_subnet"></a> [enable\_public\_subnet](#input\_enable\_public\_subnet) | Set true to enable public subnets | `bool` | `false` | no |
141-
| <a name="input_environment"></a> [environment](#input\_environment) | Specify the environment indentifier for the VPC | `string` | `""` | no |
135+
| <a name="input_environment"></a> [environment](#input\_environment) | Specify the environment indentifier for the VPC | `string` | n/a | yes |
142136
| <a name="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 |
143137
| <a name="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 |
144138
| <a name="input_intra_subnet_cidrs"></a> [intra\_subnet\_cidrs](#input\_intra\_subnet\_cidrs) | A list of intra subnets CIDR to be created | `list(any)` | `[]` | no |
145-
| <a name="input_name"></a> [name](#input\_name) | Specify the name of the VPC | `string` | `""` | no |
139+
| <a name="input_name"></a> [name](#input\_name) | Specify the name of the VPC | `string` | n/a | yes |
146140
| <a name="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 |
147141
| <a name="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 |
148142
| <a name="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 |

examples/simple-vpc/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ locals {
22
region = "us-east-1"
33
environment = "dev"
44
name = "simple-example"
5-
additional_tags = {
5+
additional_aws_tags = {
66
Owner = "SquareOps"
77
Expires = "Never"
88
Department = "Engineering"

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ module "vpn_server" {
113113
region = var.region
114114
vpc_cidr = var.vpc_cidr
115115
vpc_id = module.vpc.vpc_id
116-
public_subnet = module.vpc.public_subnets[0]
116+
public_subnet = module.vpc.public_subnets[0]
117117
vpn_key_pair = var.vpn_key_pair
118118
vpn_server_instance_type = var.vpn_server_instance_type
119119
}

variables.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ variable "region" {
66

77
variable "environment" {
88
description = "Specify the environment indentifier for the VPC"
9-
default = ""
109
type = string
1110
}
1211

1312
variable "name" {
1413
description = "Specify the name of the VPC"
15-
default = ""
1614
type = string
1715
}
1816

@@ -24,7 +22,6 @@ variable "vpc_cidr" {
2422

2523
variable "azs" {
2624
description = "List of Availability Zone to be used by VPC"
27-
default = []
2825
type = list(any)
2926
}
3027

0 commit comments

Comments
 (0)