Skip to content

Commit 89ba1c8

Browse files
Merge pull request #12 from ankur6405/main
Removed vpc source version to remove deprecated warning
2 parents 88bb11f + 173bea7 commit 89ba1c8

File tree

5 files changed

+36
-12
lines changed

5 files changed

+36
-12
lines changed

README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,52 @@ This module supports three scenarios to create Network resource on AWS. Each wil
5858

5959
- **simple-vpc (default behavior):** To create a VPC with public subnets and IGW.
6060
- `vpc_cidr = ""`
61-
- `enable_public_subnet = true`
61+
- `public_subnet_enabled = true`
62+
- `auto_assign_public_ip = true`
6263
- **vpc-with-private-sub:** To create a VPC with public subnets, private subnets, IGW gateway and NAT gateway.
6364
- `vpc_cidr = ""`
6465
- `public_subnet_enabled = true`
6566
- `private_subnet_enabled = true`
67+
- `auto_assign_public_ip = true`
6668

6769
- **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.
68-
- `vpc_cidr = ""`
70+
- `vpc_cidr = ""`
6971
- `public_subnet_enabled = true`
7072
- `private_subnet_enabled = true`
7173
- `database_subnet_enabled = true`
7274
- `intra_subnet_enabled = true`
75+
- `auto_assign_public_ip = true`
7376
- `one_nat_gateway_per_az = true`
7477
- `vpn_server_enabled = true`
7578
- `vpn_server_instance_type = "t3a.small"`
76-
- `vpn_key_pair = ""`
79+
- `vpn_key_pair_name = ""`
80+
- `availability_zones = 2`
7781
- `flow_log_enabled = true`
7882
- `flow_log_max_aggregation_interval = 60`
7983
- `flow_log_cloudwatch_log_group_retention_in_days = 90`
8084

8185
- **vpc-peering:** VPC peering support is available using submodule `vpc_peering`. Refer [Peering Docs](https://github.com/squareops/terraform-aws-vpc/tree/main/modules/vpc_peering) for more information
86+
- `accepter_name = ""`
87+
- `accepter_vpc_id = ""`
88+
- `accepter_vpc_region = ""`
89+
- `requester_name = ""`
90+
- `requester_vpc_id = ""`
91+
- `requester_vpc_region = ""`
92+
- `auto_assign_public_ip = true`
93+
- `one_nat_gateway_per_az = true`
8294

8395
- **vpc-with-ipv6:** To create VPC with IPv6 support, you only need to enable the parameter `ipv6_enabled`. Rest all the configurations will be taken care by module. Refer for example [vpc-with-ipv6](https://github.com/squareops/terraform-aws-vpc/tree/main/examples/vpc-with-ipv6) for more information.
84-
96+
- `vpc_cidr = ""`
97+
- `public_subnet_enabled = true`
98+
- `private_subnet_enabled = true`
99+
- `database_subnet_enabled = true`
100+
- `intra_subnet_enabled = true`
101+
- `auto_assign_public_ip = true`
102+
- `ipv6_enabled = true`
103+
- `public_subnet_assign_ipv6_address_on_creation = true`
104+
- `private_subnet_assign_ipv6_address_on_creation = true`
105+
- `database_subnet_assign_ipv6_address_on_creation = true`
106+
- `intra_subnet_assign_ipv6_address_on_creation = true`
85107

86108
# IAM Permissions
87109
The required IAM permissions to create resources from this module can be found [here](https://github.com/squareops/terraform-aws-vpc/blob/main/IAM.md)
@@ -138,7 +160,7 @@ In this module, we have implemented the following CIS Compliance checks for VPC:
138160

139161
| Name | Source | Version |
140162
|------|--------|---------|
141-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | 4.0.2 |
163+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | 5.1.1 |
142164
| <a name="module_vpn_server"></a> [vpn\_server](#module\_vpn\_server) | ./modules/vpn | n/a |
143165

144166
## Resources

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ data "aws_ec2_instance_type" "arch" {
3535

3636
module "vpc" {
3737
source = "terraform-aws-modules/vpc/aws"
38-
version = "4.0.2"
38+
version = "5.1.1"
3939
name = format("%s-%s-vpc", var.environment, var.name)
4040
cidr = var.vpc_cidr # CIDR FOR VPC
4141
azs = [for n in range(0, var.availability_zones) : data.aws_availability_zones.available.names[n]]

modules/vpn/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Refer [this](https://pritunl.com/) for more information.
2525
| Name | Version |
2626
|------|---------|
2727
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.23 |
28+
| <a name="provider_null"></a> [null](#provider\_null) | n/a |
2829
| <a name="provider_template"></a> [template](#provider\_template) | >= 2.2.0 |
2930
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.9.1 |
3031

@@ -46,7 +47,8 @@ Refer [this](https://pritunl.com/) for more information.
4647
| [aws_iam_role_policy_attachment.SecretsManagerReadWrite_attachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
4748
| [aws_ssm_association.ssm_association](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_association) | resource |
4849
| [aws_ssm_document.ssm_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_document) | resource |
49-
| [time_sleep.wait_2_min](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
50+
| [null_resource.delete_secret](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
51+
| [time_sleep.wait_3_min](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
5052
| [aws_ami.ubuntu_20_ami](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ami) | data source |
5153
| [aws_iam_policy.SSMManagedInstanceCore](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy) | data source |
5254
| [aws_iam_policy.SecretsManagerReadWrite](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy) | data source |

modules/vpn/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "aws_eip" "vpn" {
2-
vpc = true
2+
domain = "vpc"
33
instance = module.vpn_server.id
44
}
55

@@ -206,11 +206,11 @@ DOC
206206
resource "null_resource" "delete_secret" {
207207
triggers = {
208208
environment = var.environment
209-
name = var.name
210-
region = data.aws_region.current.name
209+
name = var.name
210+
region = data.aws_region.current.name
211211
}
212212
provisioner "local-exec" {
213-
when = destroy
213+
when = destroy
214214
interpreter = ["/bin/bash", "-c"]
215215
command = <<EOT
216216
aws secretsmanager delete-secret --secret-id ${self.triggers.environment}-${self.triggers.name}-vpn --force-delete-without-recovery --region ${self.triggers.region}

modules/vpn/scripts/pritunl-vpn.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ sleep 10
2828
sudo pritunl set-mongodb mongodb://localhost:27017/pritunl
2929

3030
sudo systemctl enable mongod pritunl
31-
sudo systemctl start mongod pritunl
31+
sudo systemctl start mongod pritunl

0 commit comments

Comments
 (0)