From 096e1a11694bd440f0a6d6b43361ed77c2e828fc Mon Sep 17 00:00:00 2001 From: keneobum881 Date: Tue, 21 May 2024 12:07:52 -0400 Subject: [PATCH 1/2] deploying a vpc --- environments/dev/main.tf | 20 +------------------- modules/vpc/main.tf | 20 +++++--------------- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/environments/dev/main.tf b/environments/dev/main.tf index 5c8bdc5623..05ab05877b 100644 --- a/environments/dev/main.tf +++ b/environments/dev/main.tf @@ -25,22 +25,4 @@ module "vpc" { source = "../../modules/vpc" project = "${var.project}" env = "${local.env}" -} - -module "http_server" { - source = "../../modules/http_server" - project = "${var.project}" - subnet = "${module.vpc.subnet}" -} - -module "firewall" { - source = "../../modules/firewall" - project = "${var.project}" - subnet = "${module.vpc.subnet}" -} - -# module "vpc2" { -# source = "../../modules/vpc" -# project = "${var.project}" -# env = "${local.env}" -# } \ No newline at end of file +} \ No newline at end of file diff --git a/modules/vpc/main.tf b/modules/vpc/main.tf index 4335eb23ee..03c95a5336 100644 --- a/modules/vpc/main.tf +++ b/modules/vpc/main.tf @@ -26,24 +26,14 @@ module "vpc" { subnet_ip = "10.${var.env == "dev" ? 10 : 20}.10.0/24" subnet_region = "us-west1" }, + { + subnet_name = "${var.env}-subnet-02" + subnet_ip = "10.${var.env == "dev" ? 10 : 20}.11.0/24" + subnet_region = "us-west1" + }, ] secondary_ranges = { "${var.env}-subnet-01" = [] } -} - -module "vpc2" { - source = "terraform-google-modules/network/google" - version = "3.3.0" - - project_id = "${var.project}" - network_name = "${var.env}-ken" - subnets = [ - { - subnet_name = "${var.env}-subnet-ken" - subnet_ip = "10.${var.env == "dev" ? 10 : 20}.10.0/16" - subnet_region = "us-west2" - }, - ] } \ No newline at end of file From c743702b4d1187806b8ae263c056d5fc0148fde5 Mon Sep 17 00:00:00 2001 From: keneobum881 Date: Tue, 21 May 2024 12:12:50 -0400 Subject: [PATCH 2/2] deploying a vpc --- environments/dev/outputs.tf | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/environments/dev/outputs.tf b/environments/dev/outputs.tf index 0ae139e4f7..18d8f03898 100644 --- a/environments/dev/outputs.tf +++ b/environments/dev/outputs.tf @@ -20,15 +20,3 @@ output "network" { output "subnet" { value = "${module.vpc.subnet}" } - -output "firewall_rule" { - value = "${module.firewall.firewall_rule}" -} - -output "instance_name" { - value = "${module.http_server.instance_name}" -} - -output "external_ip" { - value = "${module.http_server.external_ip}" -}