Skip to content

Commit 1557bd0

Browse files
Changes related to PR review
1 parent e9867b6 commit 1557bd0

File tree

11 files changed

+24
-30
lines changed

11 files changed

+24
-30
lines changed

3-networks-dual-svpc/envs/production/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
locals {
18-
env = "nonproduction"
18+
env = "production"
1919
environment_code = substr(local.env, 0, 1)
2020
/*
2121
* Base network ranges

3-networks-dual-svpc/modules/base_env/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
| restricted\_subnets\_names | The names of the subnets being created |
5858
| restricted\_subnets\_secondary\_ranges | The secondary ranges associated with these subnets |
5959
| restricted\_subnets\_self\_links | The self-links of subnets being created |
60-
| target\_name\_server\_addresses | List of IPv4 address of target name servers for the forwarding zone configuration |
60+
| target\_name\_server\_addresses | List of IPv4 addresses of the target name servers for the forwarding zone configuration. These IP addresses should point to the name server responsible for replying to DNS queries. |
6161

6262
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

3-networks-dual-svpc/modules/base_env/main.tf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,9 @@ locals {
169169
module "restricted_shared_vpc" {
170170
source = "../restricted_shared_vpc"
171171

172-
project_id = local.restricted_project_id
173-
project_number = local.restricted_project_number
174-
prod_restricted_project_id = local.prod_restricted_project_id
175-
176-
172+
project_id = local.restricted_project_id
173+
project_number = local.restricted_project_number
174+
production_restricted_project_id = local.production_restricted_project_id
177175
environment_code = var.environment_code
178176
access_context_manager_policy_id = var.access_context_manager_policy_id
179177
restricted_services = local.restricted_services
@@ -267,7 +265,7 @@ module "base_shared_vpc" {
267265
source = "../base_shared_vpc"
268266

269267
project_id = local.base_project_id
270-
production_project_id = local.prod_base_project_id
268+
production_project_id = local.production_base_project_id
271269
environment_code = var.environment_code
272270
private_service_cidr = var.base_private_service_cidr
273271
private_service_connect_ip = var.base_private_service_connect_ip

3-networks-dual-svpc/modules/base_env/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
output "target_name_server_addresses" {
1818
value = var.target_name_server_addresses
19-
description = "List of IPv4 address of target name servers for the forwarding zone configuration"
19+
description = "List of IPv4 addresses of the target name servers for the forwarding zone configuration. These IP addresses should point to the name server responsible for replying to DNS queries."
2020
}
2121

2222

3-networks-dual-svpc/modules/base_env/remote.tf

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@
1515
*/
1616

1717
locals {
18-
restricted_project_id = data.terraform_remote_state.org.outputs.shared_vpc_projects[var.env].restricted_shared_vpc_project_id
19-
base_project_id = data.terraform_remote_state.org.outputs.shared_vpc_projects[var.env].base_shared_vpc_project_id
20-
restricted_project_number = data.terraform_remote_state.org.outputs.shared_vpc_projects[var.env].restricted_shared_vpc_project_number
21-
interconnect_project_number = data.terraform_remote_state.org.outputs.interconnect_project_number
22-
organization_service_account = data.terraform_remote_state.bootstrap.outputs.organization_step_terraform_service_account_email
23-
networks_service_account = data.terraform_remote_state.bootstrap.outputs.networks_step_terraform_service_account_email
24-
projects_service_account = data.terraform_remote_state.bootstrap.outputs.projects_step_terraform_service_account_email
25-
prod_restricted_project_id = data.terraform_remote_state.org.outputs.shared_vpc_projects["production"].restricted_shared_vpc_project_id
26-
prod_base_project_id = data.terraform_remote_state.org.outputs.shared_vpc_projects["production"].base_shared_vpc_project_id
27-
18+
restricted_project_id = data.terraform_remote_state.org.outputs.shared_vpc_projects[var.env].restricted_shared_vpc_project_id
19+
base_project_id = data.terraform_remote_state.org.outputs.shared_vpc_projects[var.env].base_shared_vpc_project_id
20+
restricted_project_number = data.terraform_remote_state.org.outputs.shared_vpc_projects[var.env].restricted_shared_vpc_project_number
21+
interconnect_project_number = data.terraform_remote_state.org.outputs.interconnect_project_number
22+
organization_service_account = data.terraform_remote_state.bootstrap.outputs.organization_step_terraform_service_account_email
23+
networks_service_account = data.terraform_remote_state.bootstrap.outputs.networks_step_terraform_service_account_email
24+
projects_service_account = data.terraform_remote_state.bootstrap.outputs.projects_step_terraform_service_account_email
25+
production_restricted_project_id = data.terraform_remote_state.org.outputs.shared_vpc_projects["production"].restricted_shared_vpc_project_id
26+
production_base_project_id = data.terraform_remote_state.org.outputs.shared_vpc_projects["production"].base_shared_vpc_project_id
2827
}
2928

3029

3-networks-dual-svpc/modules/base_shared_vpc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
| nat\_num\_addresses\_region2 | Number of external IPs to reserve for second Cloud NAT. | `number` | `2` | no |
2020
| private\_service\_cidr | CIDR range for private service networking. Used for Cloud SQL and other managed services. | `string` | `null` | no |
2121
| private\_service\_connect\_ip | Internal IP to be used as the private service connect endpoint | `string` | n/a | yes |
22-
| production\_project\_id | production project | `string` | `""` | no |
22+
| production\_project\_id | Project ID for Base Shared. | `string` | `""` | no |
2323
| project\_id | Project ID for Private Shared VPC. | `string` | n/a | yes |
2424
| secondary\_ranges | Secondary ranges that will be used in some of the subnets | `map(list(object({ range_name = string, ip_cidr_range = string })))` | `{}` | no |
2525
| subnets | The list of subnets being created | <pre>list(object({<br> subnet_name = string<br> subnet_ip = string<br> subnet_region = string<br> subnet_private_access = optional(string, "false")<br> subnet_private_ipv6_access = optional(string)<br> subnet_flow_logs = optional(string, "false")<br> subnet_flow_logs_interval = optional(string, "INTERVAL_5_SEC")<br> subnet_flow_logs_sampling = optional(string, "0.5")<br> subnet_flow_logs_metadata = optional(string, "INCLUDE_ALL_METADATA")<br> subnet_flow_logs_filter = optional(string, "true")<br> subnet_flow_logs_metadata_fields = optional(list(string), [])<br> description = optional(string)<br> purpose = optional(string)<br> role = optional(string)<br> stack_type = optional(string)<br> ipv6_access_type = optional(string)<br> }))</pre> | `[]` | no |

3-networks-dual-svpc/modules/base_shared_vpc/dns.tf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ module "peering_zone" {
4444
version = "~> 5.0"
4545

4646
count = var.environment_code != "p" ? 1 : 0
47-
#count = var.environment_code != "d" ? 1 : 0
4847

4948
project_id = var.project_id
5049
type = "peering"
@@ -56,7 +55,6 @@ module "peering_zone" {
5655
module.main.network_self_link
5756
]
5857
target_network = data.google_compute_network.vpc_dns_hub[0].self_link
59-
#target_network = data.google_compute_network.vpc_dns_hub.self_link
6058
}
6159

6260
/******************************************
@@ -66,7 +64,7 @@ module "dns_forwarding_zone" {
6664
source = "terraform-google-modules/cloud-dns/google"
6765
version = "~> 5.0"
6866

69-
count = var.environment_code == "p" ? 1 : 0 ####added
67+
count = var.environment_code == "p" ? 1 : 0
7068

7169
project_id = var.project_id
7270
type = "forwarding"

3-networks-dual-svpc/modules/base_shared_vpc/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ variable "base_network_name" {
2626
}
2727

2828
variable "production_project_id" {
29-
description = "production project"
29+
description = "Project ID for Base Shared."
3030
type = string
3131
default = ""
3232
}

3-networks-dual-svpc/modules/restricted_shared_vpc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
| nat\_num\_addresses\_region2 | Number of external IPs to reserve for region 2 Cloud NAT. | `number` | `2` | no |
2727
| private\_service\_cidr | CIDR range for private service networking. Used for Cloud SQL and other managed services. | `string` | `null` | no |
2828
| private\_service\_connect\_ip | Internal IP to be used as the private service connect endpoint. | `string` | n/a | yes |
29-
| prod\_restricted\_project\_id | production project | `string` | `""` | no |
29+
| production\_restricted\_project\_id | Project ID for Restricted Shared. | `string` | `""` | no |
3030
| project\_id | Project ID for Restricted Shared VPC. | `string` | n/a | yes |
3131
| project\_number | Project number for Restricted Shared VPC. It is the project INSIDE the regular service perimeter. | `number` | n/a | yes |
3232
| restricted\_net\_hub\_project\_id | The restricted net hub project ID | `string` | `""` | no |

3-networks-dual-svpc/modules/restricted_shared_vpc/dns.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ data "google_compute_network" "vpc_dns_hub" {
3636
count = var.environment_code != "p" ? 1 : 0
3737

3838
name = "vpc-p-shared-restricted"
39-
project = var.prod_restricted_project_id
39+
project = var.production_restricted_project_id
4040
}
4141

4242
module "peering_zone" {
@@ -64,7 +64,7 @@ module "dns_forwarding_zone" {
6464
source = "terraform-google-modules/cloud-dns/google"
6565
version = "~> 5.0"
6666

67-
count = var.environment_code == "p" ? 1 : 0 ####added
67+
count = var.environment_code == "p" ? 1 : 0
6868

6969
project_id = var.project_id
7070
type = "forwarding"

0 commit comments

Comments
 (0)