Skip to content

Commit

Permalink
update vpc.tf, tf-run.data
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jan 20, 2023
1 parent 2258628 commit a78ef0a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 20 deletions.
9 changes: 8 additions & 1 deletion examples/full-setup-tf-upgrade/tf-run.data
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
VERSION 1.2.1
VERSION 1.2.2
REMOTE-STATE
COMMAND tf-directory-setup.py -l none -f
COMMAND setup-new-directory.sh
COMMAND tf-init -upgrade

LINKTOP includes.d/variables.account_tags.tf
LINKTOP includes.d/variables.account_tags.auto.tfvars
LINKTOP includes.d/variables.infrastructure_tags.tf
LINKTOP includes.d/variables.infrastructure_tags.auto.tfvars
LINKTOP includes.d/variables.application_tags.tf
## LINKTOP includes.d/variables.application_tags.auto.tfvars

LINKTOP provider_configs.d/provider.infoblox.auto.tfvars
LINKTOP provider_configs.d/provider.infoblox.tf
LINKTOP provider_configs.d/provider.infoblox.variables.tf
Expand Down
27 changes: 14 additions & 13 deletions examples/full-setup-tf-upgrade/variables.vpc.auto.tfvars
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
vpc_name = "dice-ite"
vpc_cidr_block = "10.188.64.0/19"
vpc_index = "4"
vpc_short_name = "vpc4"
vpc_full_name = "vpc4-dice-ite"
vpc_environment = "ite"
vpc_domain_name = "ite.dice.census.gov"
vpc_dns_servers = ["148.129.127.22", "148.129.191.22"]
vpc_ntp_servers = ["148.129.127.23", "148.129.191.23"]
vpc_enable_igw = false
vpc_enable_nat = false
vpc_enable_vpn = true
vpc_enable_awsdns = true
vpc_name = "dice-ite"
vpc_cidr_block = "10.188.64.0/19"
vpc_index = "4"
vpc_short_name = "vpc4"
vpc_full_name = "vpc4-dice-ite"
vpc_environment = "ite"
vpc_domain_name = "ite.dice.census.gov"
vpc_dns_servers = ["148.129.127.22", "148.129.191.22"]
vpc_ntp_servers = ["148.129.127.23", "148.129.191.23"]
vpc_enable_igw = false
vpc_enable_nat = false
vpc_enable_vpn = true
vpc_enable_awsdns = true
availability_zones = []

vpn_settings = [
{ site = "hq", "bgp_asn_id" = 65510, "ip_address" = "148.129.163.NNN" },
Expand Down
33 changes: 27 additions & 6 deletions examples/full-setup-tf-upgrade/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ module "vpc" {

tags = merge(
local.tags,
var.account_tags,
var.application_tags,
tomap({ "boc:tgw_environment" = var.tgw_environment }),
)
}
Expand All @@ -32,18 +34,23 @@ module "subnets" {

vpc_id = local.vpc_id
vpc_full_name = var.vpc_full_name
availability_zones = []
availability_zones = var.availability_zones
public_subnets = var.public_subnets
private_subnets = var.private_subnets
tags = local.tags

tags = merge(
local.tags,
var.account_tags,
var.application_tags,
)
}

module "routing" {
source = "git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//routing?ref=tf-upgrade"
vpc_id = local.vpc_id

vpc_full_name = var.vpc_full_name
availability_zones = []
availability_zones = var.availability_zones
# private_subnets_ids = module.subnets.private_subnets_ids
private_subnets_ids = [for sn in module.subnets.private_subnets_ids : sn if lookup(sn.tags, "boc:vpc:route-table", null) != "attachment"]
public_subnets_ids = module.subnets.public_subnets_ids
Expand All @@ -56,7 +63,11 @@ module "routing" {
vpc_index = var.vpc_index
vpc_environment = var.vpc_environment

tags = local.tags
tags = merge(
local.tags,
var.account_tags,
var.application_tags,
)
}

module "vpn" {
Expand All @@ -69,7 +80,12 @@ module "vpn" {
vpc_environment = var.vpc_environment
vpn_settings = var.vpn_settings
route_table_ids = values(module.routing.private_route_table_ids)
tags = local.tags

tags = merge(
local.tags,
var.account_tags,
var.application_tags,
)
}

module "base-security-groups" {
Expand All @@ -78,5 +94,10 @@ module "base-security-groups" {

vpc_full_name = var.vpc_full_name
vpc_environment = var.vpc_environment
tags = local.tags

tags = merge(
local.tags,
var.account_tags,
var.application_tags,
)
}

0 comments on commit a78ef0a

Please sign in to comment.