From e929c15a88f4969777b4dbe4bb5882f82bf20744 Mon Sep 17 00:00:00 2001 From: Ryan Goh <1871494+ryanoolala@users.noreply.github.com> Date: Fri, 11 Aug 2023 11:13:54 +0800 Subject: [PATCH] chore: updated module to use v4.0.0 [major] --- main.tf | 21 ++++++++++- variables.tf | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 451c85d..6328506 100644 --- a/main.tf +++ b/main.tf @@ -24,7 +24,7 @@ resource "aws_eip" "nat" { # virtual private cloud creator module "vpc" { - source = "github.com/GovTechSG/terraform-aws-vpc-forked?ref=v3.7.0" + source = "github.com/GovTechSG/terraform-aws-vpc-forked?ref=v4.0.0" # meta data name = var.vpc_name @@ -110,6 +110,25 @@ module "vpc" { # others map_public_ip_on_launch = var.map_public_ip_on_launch tags = merge(var.tags, local.vpc_tags) + + manage_default_vpc = var.manage_default_vpc + default_vpc_tags = var.default_vpc_tags + default_vpc_name = var.default_vpc_name + default_vpc_enable_dns_support = var.default_vpc_enable_dns_support + default_vpc_enable_dns_hostnames = var.default_vpc_enable_dns_hostnames + + manage_default_security_group = var.manage_default_security_group + default_security_group_name = var.default_security_group_name + default_security_group_ingress = var.default_security_group_ingress + default_security_group_egress = var.default_security_group_egress + default_security_group_tags = var.default_security_group_tags + + manage_default_route_table = var.manage_default_route_table + default_route_table_name = var.default_route_table_name + default_route_table_propagating_vgws = var.default_route_table_propagating_vgws + default_route_table_routes = var.default_route_table_routes + default_route_table_tags = var.default_route_table_tags + } ####################### diff --git a/variables.tf b/variables.tf index cd83f0a..ab4261c 100644 --- a/variables.tf +++ b/variables.tf @@ -181,3 +181,102 @@ variable "default_network_acl_tags" { type = map(string) default = {} } + +################################################################################ +# Default VPC +################################################################################ + +variable "manage_default_vpc" { + description = "Should be true to adopt and manage Default VPC" + type = bool + default = false +} + +variable "default_vpc_name" { + description = "Name to be used on the Default VPC" + type = string + default = null +} + +variable "default_vpc_enable_dns_support" { + description = "Should be true to enable DNS support in the Default VPC" + type = bool + default = true +} + +variable "default_vpc_enable_dns_hostnames" { + description = "Should be true to enable DNS hostnames in the Default VPC" + type = bool + default = true +} + +variable "default_vpc_tags" { + description = "Additional tags for the Default VPC" + type = map(string) + default = {} +} + +variable "manage_default_security_group" { + description = "Should be true to adopt and manage default security group" + type = bool + default = true +} + +variable "default_security_group_name" { + description = "Name to be used on the default security group" + type = string + default = null +} + +variable "default_security_group_ingress" { + description = "List of maps of ingress rules to set on the default security group" + type = list(map(string)) + default = [] +} + +variable "default_security_group_egress" { + description = "List of maps of egress rules to set on the default security group" + type = list(map(string)) + default = [] +} + +variable "default_security_group_tags" { + description = "Additional tags for the default security group" + type = map(string) + default = {} +} + + +################################################################################ +# Default Route +################################################################################ + +variable "manage_default_route_table" { + description = "Should be true to manage default route table" + type = bool + default = true +} + +variable "default_route_table_name" { + description = "Name to be used on the default route table" + type = string + default = null +} + +variable "default_route_table_propagating_vgws" { + description = "List of virtual gateways for propagation" + type = list(string) + default = [] +} + +variable "default_route_table_routes" { + description = "Configuration block of routes. See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/default_route_table#route" + type = list(map(string)) + default = [] +} + +variable "default_route_table_tags" { + description = "Additional tags for the default route table" + type = map(string) + default = {} +}