Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add onprem_dc variable and add missing routers in hub and spoke base and restricted modules #912

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 3-networks-dual-svpc/envs/shared/dns-hub.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module "dns_hub_region1_router1" {
network = module.dns_hub_vpc.network_name
region = local.default_region1
bgp = {
asn = var.bgp_asn_dns
asn = local.dns_bgp_asn_number
advertised_ip_ranges = [{ range = "35.199.192.0/19" }]
}
}
Expand All @@ -109,7 +109,7 @@ module "dns_hub_region1_router2" {
network = module.dns_hub_vpc.network_name
region = local.default_region1
bgp = {
asn = var.bgp_asn_dns
asn = local.dns_bgp_asn_number
advertised_ip_ranges = [{ range = "35.199.192.0/19" }]
}
}
Expand All @@ -122,7 +122,7 @@ module "dns_hub_region2_router1" {
network = module.dns_hub_vpc.network_name
region = local.default_region2
bgp = {
asn = var.bgp_asn_dns
asn = local.dns_bgp_asn_number
advertised_ip_ranges = [{ range = "35.199.192.0/19" }]
}
}
Expand All @@ -135,7 +135,7 @@ module "dns_hub_region2_router2" {
network = module.dns_hub_vpc.network_name
region = local.default_region2
bgp = {
asn = var.bgp_asn_dns
asn = local.dns_bgp_asn_number
advertised_ip_ranges = [{ range = "35.199.192.0/19" }]
}
}
4 changes: 4 additions & 0 deletions 3-networks-dual-svpc/envs/shared/interconnect.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,27 @@ module "dns_hub_interconnect" {
region1_interconnect1_vlan_tag8021q = "3931"
region1_interconnect1 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-1"
region1_interconnect1_location = "las-zone1-770"
region1_interconnect1_onprem_dc = "onprem-dc1"
region1_router2_name = module.dns_hub_region1_router2.router.name
region1_interconnect2_candidate_subnets = ["169.254.0.8/29"]
region1_interconnect2_vlan_tag8021q = "3932"
region1_interconnect2 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-2"
region1_interconnect2_location = "las-zone1-770"
region1_interconnect2_onprem_dc = "onprem-dc2"

region2 = local.default_region2
region2_router1_name = module.dns_hub_region2_router1.router.name
region2_interconnect1_candidate_subnets = ["169.254.0.16/29"]
region2_interconnect1_vlan_tag8021q = "3933"
region2_interconnect1 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-3"
region2_interconnect1_location = "lax-zone2-19"
region2_interconnect1_onprem_dc = "onprem-dc3"
region2_router2_name = module.dns_hub_region2_router2.router.name
region2_interconnect2_candidate_subnets = ["169.254.0.24/29"]
region2_interconnect2_vlan_tag8021q = "3934"
region2_interconnect2 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-4"
region2_interconnect2_location = "lax-zone1-403"
region2_interconnect2_onprem_dc = "onprem-dc4"

peer_asn = "64515"
peer_name = "interconnect-peer"
Expand Down
2 changes: 1 addition & 1 deletion 3-networks-dual-svpc/envs/shared/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
locals {
env = "common"
environment_code = "c"
bgp_asn_number = var.enable_partner_interconnect ? "16550" : "64514"
dns_bgp_asn_number = var.enable_partner_interconnect ? "16550" : var.bgp_asn_dns
default_region1 = "us-west1"
default_region2 = "us-central1"
folder_prefix = data.terraform_remote_state.bootstrap.outputs.common_config.folder_prefix
Expand Down
50 changes: 28 additions & 22 deletions 3-networks-dual-svpc/envs/shared/partner_interconnect.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,23 @@ module "shared_restricted_interconnect" {

attachment_project_id = local.restricted_net_hub_project_id
vpc_name = "${local.environment_code}-shared-restricted"
vpc_type = "restricted"
preactivate = var.preactivate_partner_interconnect

region1 = local.default_region1
region1_router1_name = module.restricted_shared_vpc[0].region1_router1.router.name
region1_interconnect1_location = "las-zone1-770"
region1_router2_name = module.restricted_shared_vpc[0].region1_router2.router.name
region1_interconnect2_location = "las-zone1-770"
region1 = local.default_region1
region1_router1_name = module.restricted_shared_vpc[0].region1_router1.router.name
region1_interconnect1_location = "las-zone1-770"
region1_interconnect1_onprem_dc = "onprem-dc1"
region1_router2_name = module.restricted_shared_vpc[0].region1_router2.router.name
region1_interconnect2_location = "las-zone1-770"
region1_interconnect2_onprem_dc = "onprem-dc2"

region2 = local.default_region2
region2_router1_name = module.restricted_shared_vpc[0].region2_router1.router.name
region2_interconnect1_location = "lax-zone2-19"
region2_router2_name = module.restricted_shared_vpc[0].region2_router2.router.name
region2_interconnect2_location = "lax-zone1-403"
region2 = local.default_region2
region2_router1_name = module.restricted_shared_vpc[0].region2_router1.router.name
region2_interconnect1_location = "lax-zone2-19"
region2_interconnect1_onprem_dc = "onprem-dc3"
region2_router2_name = module.restricted_shared_vpc[0].region2_router2.router.name
region2_interconnect2_location = "lax-zone1-403"
region2_interconnect2_onprem_dc = "onprem-dc4"

cloud_router_labels = {
vlan_1 = "cr5",
Expand All @@ -47,20 +50,23 @@ module "shared_base_interconnect" {

attachment_project_id = local.base_net_hub_project_id
vpc_name = "${local.environment_code}-shared-base"
vpc_type = "base"
preactivate = var.preactivate_partner_interconnect

region1 = local.default_region1
region1_router1_name = module.base_shared_vpc[0].region1_router1.router.name
region1_interconnect1_location = "las-zone1-770"
region1_router2_name = module.base_shared_vpc[0].region1_router2.router.name
region1_interconnect2_location = "las-zone1-770"
region1 = local.default_region1
region1_router1_name = module.base_shared_vpc[0].region1_router1.router.name
region1_interconnect1_location = "las-zone1-770"
region1_interconnect1_onprem_dc = "onprem-dc1"
region1_router2_name = module.base_shared_vpc[0].region1_router2.router.name
region1_interconnect2_location = "las-zone1-770"
region1_interconnect2_onprem_dc = "onprem-dc2"

region2 = local.default_region2
region2_router1_name = module.base_shared_vpc[0].region2_router1.router.name
region2_interconnect1_location = "lax-zone2-19"
region2_router2_name = module.base_shared_vpc[0].region2_router2.router.name
region2_interconnect2_location = "lax-zone1-403"
region2 = local.default_region2
region2_router1_name = module.base_shared_vpc[0].region2_router1.router.name
region2_interconnect1_location = "lax-zone2-19"
region2_interconnect1_onprem_dc = "onprem-dc3"
region2_router2_name = module.base_shared_vpc[0].region2_router2.router.name
region2_interconnect2_location = "lax-zone1-403"
region2_interconnect2_onprem_dc = "onprem-dc4"

cloud_router_labels = {
vlan_1 = "cr1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,27 @@ module "shared_restricted_interconnect" {
region1_interconnect1_vlan_tag8021q = "3901"
region1_interconnect1 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-1"
region1_interconnect1_location = "las-zone1-770"
region1_interconnect1_onprem_dc = "onprem-dc1"
region1_router2_name = module.restricted_shared_vpc.region1_router2.router.name
region1_interconnect2_candidate_subnets = ["169.254.0.168/29"]
region1_interconnect2_vlan_tag8021q = "3902"
region1_interconnect2 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-2"
region1_interconnect2_location = "las-zone1-770"
region1_interconnect2_onprem_dc = "onprem-dc2"

region2 = var.default_region2
region2_router1_name = module.restricted_shared_vpc.region2_router1.router.name
region2_interconnect1_candidate_subnets = ["169.254.0.176/29"]
region2_interconnect1_vlan_tag8021q = "3903"
region2_interconnect1 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-3"
region2_interconnect1_location = "lax-zone2-19"
region2_interconnect1_onprem_dc = "onprem-dc3"
region2_router2_name = module.restricted_shared_vpc.region2_router2.router.name
region2_interconnect2_candidate_subnets = ["169.254.0.184/29"]
region2_interconnect2_vlan_tag8021q = "3904"
region2_interconnect2 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-4"
region2_interconnect2_location = "lax-zone1-403"
region2_interconnect2_onprem_dc = "onprem-dc4"

peer_asn = "64515"
peer_name = "interconnect-peer"
Expand Down Expand Up @@ -71,23 +75,27 @@ module "shared_base_interconnect" {
region1_interconnect1_vlan_tag8021q = "3905"
region1_interconnect1 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-1"
region1_interconnect1_location = "las-zone1-770"
region1_interconnect1_onprem_dc = "onprem-dc1"
region1_router2_name = module.base_shared_vpc.region1_router2.router.name
region1_interconnect2_candidate_subnets = ["169.254.0.200/29"]
region1_interconnect2_vlan_tag8021q = "3906"
region1_interconnect2 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-2"
region1_interconnect2_location = "las-zone1-770"
region1_interconnect2_onprem_dc = "onprem-dc2"

region2 = var.default_region2
region2_router1_name = module.base_shared_vpc.region2_router1.router.name
region2_interconnect1_candidate_subnets = ["169.254.0.208/29"]
region2_interconnect1_vlan_tag8021q = "3907"
region2_interconnect1 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-3"
region2_interconnect1_location = "lax-zone2-19"
region2_interconnect1_onprem_dc = "onprem-dc3"
region2_router2_name = module.base_shared_vpc.region2_router2.router.name
region2_interconnect2_candidate_subnets = ["169.254.0.216/29"]
region2_interconnect2_vlan_tag8021q = "3908"
region2_interconnect2 = "https://www.googleapis.com/compute/v1/projects/example-interconnect-project/global/interconnects/example-interconnect-4"
region2_interconnect2_location = "lax-zone1-403"
region2_interconnect2_onprem_dc = "onprem-dc4"


peer_asn = "64515"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,23 @@ module "shared_restricted_interconnect" {

attachment_project_id = local.restricted_project_id
vpc_name = "${var.environment_code}-shared-restricted"
vpc_type = "restricted"
preactivate = true

region1 = var.default_region1
region1_router1_name = module.restricted_shared_vpc.region1_router1.router.name
region1_interconnect1_location = "las-zone1-770"
region1_router2_name = module.restricted_shared_vpc.region1_router2.router.name
region1_interconnect2_location = "las-zone1-770"
region1 = var.default_region1
region1_router1_name = module.restricted_shared_vpc.region1_router1.router.name
region1_interconnect1_location = "las-zone1-770"
region1_interconnect1_onprem_dc = "onprem-dc1"
region1_router2_name = module.restricted_shared_vpc.region1_router2.router.name
region1_interconnect2_location = "las-zone1-770"
region1_interconnect2_onprem_dc = "onprem-dc2"

region2 = var.default_region2
region2_router1_name = module.restricted_shared_vpc.region2_router1.router.name
region2_interconnect1_location = "lax-zone2-19"
region2_router2_name = module.restricted_shared_vpc.region2_router2.router.name
region2_interconnect2_location = "lax-zone1-403"
region2 = var.default_region2
region2_router1_name = module.restricted_shared_vpc.region2_router1.router.name
region2_interconnect1_location = "lax-zone2-19"
region2_interconnect1_onprem_dc = "onprem-dc3"
region2_router2_name = module.restricted_shared_vpc.region2_router2.router.name
region2_interconnect2_location = "lax-zone1-403"
region2_interconnect2_onprem_dc = "onprem-dc4"

cloud_router_labels = {
vlan_1 = "cr5",
Expand All @@ -51,20 +54,23 @@ module "shared_base_interconnect" {

attachment_project_id = local.base_project_id
vpc_name = "${var.environment_code}-shared-base"
vpc_type = "base"
preactivate = true

region1 = var.default_region1
region1_router1_name = module.base_shared_vpc.region1_router1.router.name
region1_interconnect1_location = "las-zone1-770"
region1_router2_name = module.base_shared_vpc.region1_router2.router.name
region1_interconnect2_location = "las-zone1-770"
region1 = var.default_region1
region1_router1_name = module.base_shared_vpc.region1_router1.router.name
region1_interconnect1_location = "las-zone1-770"
region1_interconnect1_onprem_dc = "onprem-dc1"
region1_router2_name = module.base_shared_vpc.region1_router2.router.name
region1_interconnect2_location = "las-zone1-770"
region1_interconnect2_onprem_dc = "onprem-dc2"

region2 = var.default_region2
region2_router1_name = module.base_shared_vpc.region2_router1.router.name
region2_interconnect1_location = "lax-zone2-19"
region2_router2_name = module.base_shared_vpc.region2_router2.router.name
region2_interconnect2_location = "lax-zone1-403"
region2 = var.default_region2
region2_router1_name = module.base_shared_vpc.region2_router1.router.name
region2_interconnect1_location = "lax-zone2-19"
region2_interconnect1_onprem_dc = "onprem-dc3"
region2_router2_name = module.base_shared_vpc.region2_router2.router.name
region2_interconnect2_location = "lax-zone1-403"
region2_interconnect2_onprem_dc = "onprem-dc4"


cloud_router_labels = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,25 @@ This module implements the recommendation proposed in [Establishing 99.99% Avail
| region1\_interconnect1 | URL of the underlying Interconnect object that this attachment's traffic will traverse through. | `string` | n/a | yes |
| region1\_interconnect1\_candidate\_subnets | Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). | `list(string)` | `null` | no |
| region1\_interconnect1\_location | Name of the interconnect location used in the creation of the Interconnect for the first location of region1 | `string` | n/a | yes |
| region1\_interconnect1\_onprem\_dc | Name of the on premisses data center used in the creation of the Interconnect for the first location of region1. | `string` | n/a | yes |
| region1\_interconnect1\_vlan\_tag8021q | The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. | `string` | `null` | no |
| region1\_interconnect2 | URL of the underlying Interconnect object that this attachment's traffic will traverse through. | `string` | n/a | yes |
| region1\_interconnect2\_candidate\_subnets | Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). | `list(string)` | `null` | no |
| region1\_interconnect2\_location | Name of the interconnect location used in the creation of the Interconnect for the second location of region1 | `string` | n/a | yes |
| region1\_interconnect2\_onprem\_dc | Name of the on premisses data center used in the creation of the Interconnect for the second location of region1. | `string` | n/a | yes |
| region1\_interconnect2\_vlan\_tag8021q | The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. | `string` | `null` | no |
| region1\_router1\_name | Name of the Router 1 for Region 1 where the attachment resides. | `string` | n/a | yes |
| region1\_router2\_name | Name of the Router 2 for Region 1 where the attachment resides. | `string` | n/a | yes |
| region2 | Second subnet region. The Dedicated Interconnect module only configures two regions. | `string` | n/a | yes |
| region2\_interconnect1 | URL of the underlying Interconnect object that this attachment's traffic will traverse through. | `string` | n/a | yes |
| region2\_interconnect1\_candidate\_subnets | Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). | `list(string)` | `null` | no |
| region2\_interconnect1\_location | Name of the interconnect location used in the creation of the Interconnect for the first location of region2 | `string` | n/a | yes |
| region2\_interconnect1\_onprem\_dc | Name of the on premisses data center used in the creation of the Interconnect for the first location of region2. | `string` | n/a | yes |
| region2\_interconnect1\_vlan\_tag8021q | The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. | `string` | `null` | no |
| region2\_interconnect2 | URL of the underlying Interconnect object that this attachment's traffic will traverse through. | `string` | n/a | yes |
| region2\_interconnect2\_candidate\_subnets | Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). | `list(string)` | `null` | no |
| region2\_interconnect2\_location | Name of the interconnect location used in the creation of the Interconnect for the second location of region2 | `string` | n/a | yes |
| region2\_interconnect2\_onprem\_dc | Name of the on premisses data center used in the creation of the Interconnect for the second location of region2. | `string` | n/a | yes |
| region2\_interconnect2\_vlan\_tag8021q | The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. | `string` | `null` | no |
| region2\_router1\_name | Name of the Router 1 for Region 2 where the attachment resides. | `string` | n/a | yes |
| region2\_router2\_name | Name of the Router 2 for Region 2 where the attachment resides | `string` | n/a | yes |
Expand Down
Loading