Skip to content

Commit 02a8051

Browse files
fix!: Network dns refactory (#1365)
Co-authored-by: Amanda Karina Lopes de Oliveira <[email protected]>
1 parent 56ba738 commit 02a8051

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+681
-899
lines changed

0-bootstrap/README-GitHub.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,15 +565,15 @@ or go to [Deploying step 3-networks-hub-and-spoke](#deploying-step-3-networks-hu
565565
chmod 755 ./tf-wrapper.sh
566566
```
567567

568-
1. Rename `common.auto.example.tfvars` to `common.auto.tfvars`, rename `shared.auto.example.tfvars` to `shared.auto.tfvars` and rename `access_context.auto.example.tfvars` to `access_context.auto.tfvars`.
568+
1. Rename `common.auto.example.tfvars` to `common.auto.tfvars`, rename `production.auto.example.tfvars` to `production.auto.tfvars` and rename `access_context.auto.example.tfvars` to `access_context.auto.tfvars`.
569569

570570
```bash
571571
mv common.auto.example.tfvars common.auto.tfvars
572-
mv shared.auto.example.tfvars shared.auto.tfvars
572+
mv production.auto.example.tfvars production.auto.tfvars
573573
mv access_context.auto.example.tfvars access_context.auto.tfvars
574574
```
575575

576-
1. Update the file `shared.auto.tfvars` with the values for the `target_name_server_addresses`.
576+
1. Update the file `production.auto.tfvars` with the values for the `target_name_server_addresses`.
577577
1. Update the file `access_context.auto.tfvars` with the organization's `access_context_manager_policy_id`.
578578
579579
```bash

0-bootstrap/README-GitLab.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,15 +568,15 @@ or go to [Deploying step 3-networks-hub-and-spoke](#deploying-step-3-networks-hu
568568
chmod 755 ./*.sh
569569
```
570570

571-
1. Rename `common.auto.example.tfvars` to `common.auto.tfvars`, rename `shared.auto.example.tfvars` to `shared.auto.tfvars` and rename `access_context.auto.example.tfvars` to `access_context.auto.tfvars`.
571+
1. Rename `common.auto.example.tfvars` to `common.auto.tfvars`, rename `production.auto.example.tfvars` to `production.auto.tfvars` and rename `access_context.auto.example.tfvars` to `access_context.auto.tfvars`.
572572

573573
```bash
574574
mv common.auto.example.tfvars common.auto.tfvars
575-
mv shared.auto.example.tfvars shared.auto.tfvars
575+
mv production.auto.example.tfvars production.auto.tfvars
576576
mv access_context.auto.example.tfvars access_context.auto.tfvars
577577
```
578578

579-
1. Update the file `shared.auto.tfvars` with the values for the `target_name_server_addresses`.
579+
1. Update the file `production.auto.tfvars` with the values for the `target_name_server_addresses`.
580580
1. Update the file `access_context.auto.tfvars` with the organization's `access_context_manager_policy_id`.
581581
582582
```bash

0-bootstrap/README-Jenkins.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,16 +599,16 @@ Here you will configure a VPN Network tunnel to enable connectivity between the
599599
sed -i'' -e "s/CICD_PROJECT_ID/${CICD_PROJECT_ID}/" ./Jenkinsfile
600600
```
601601

602-
1. Rename `common.auto.example.tfvars` to `common.auto.tfvars`, rename `shared.auto.example.tfvars` to `shared.auto.tfvars` and rename `access_context.auto.example.tfvars` to `access_context.auto.tfvars`.
602+
1. Rename `common.auto.example.tfvars` to `common.auto.tfvars`, rename `production.auto.example.tfvars` to `production.auto.tfvars` and rename `access_context.auto.example.tfvars` to `access_context.auto.tfvars`.
603603

604604
```bash
605605
mv common.auto.example.tfvars common.auto.tfvars
606-
mv shared.auto.example.tfvars shared.auto.tfvars
606+
mv production.auto.example.tfvars production.auto.tfvars
607607
mv access_context.auto.example.tfvars access_context.auto.tfvars
608608
```
609609

610610
1. Update `common.auto.tfvars` file with values from your environment and bootstrap. See any of the envs folder [README.md](../3-networks-dual-svpc/envs/production/README.md) files for additional information on the values in the `common.auto.tfvars` file.
611-
1. Update `shared.auto.tfvars` file with the `target_name_server_addresses`.
611+
1. Update `production.auto.tfvars` file with the `target_name_server_addresses`.
612612
1. Update `access_context.auto.tfvars` file with the `access_context_manager_policy_id`.
613613
1. Use `terraform output` to get the backend bucket and networks step Terraform Service Account values from gcp-bootstrap output.
614614

0-bootstrap/README-Terraform-Cloud.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,15 +476,15 @@ or go to [Deploying step 3-networks-hub-and-spoke](#deploying-step-3-networks-hu
476476
chmod 755 ./tf-wrapper.sh
477477
```
478478

479-
1. Rename `common.auto.example.tfvars` to `common.auto.tfvars`, rename `shared.auto.example.tfvars` to `shared.auto.tfvars` and rename `access_context.auto.example.tfvars` to `access_context.auto.tfvars`.
479+
1. Rename `common.auto.example.tfvars` to `common.auto.tfvars`, rename `production.auto.example.tfvars` to `production.auto.tfvars` and rename `access_context.auto.example.tfvars` to `access_context.auto.tfvars`.
480480

481481
```bash
482482
mv common.auto.example.tfvars common.auto.tfvars
483-
mv shared.auto.example.tfvars shared.auto.tfvars
483+
mv production.auto.example.tfvars production.auto.tfvars
484484
mv access_context.auto.example.tfvars access_context.auto.tfvars
485485
```
486486

487-
1. Update the file `shared.auto.tfvars` with the values for the `target_name_server_addresses`.
487+
1. Update the file `production.auto.tfvars` with the values for the `target_name_server_addresses`.
488488
1. Update the file `access_context.auto.tfvars` with the organization's `access_context_manager_policy_id`.
489489
490490
```bash

1-org/envs/shared/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
| log\_export\_storage\_location | The location of the storage bucket used to export logs. | `string` | `null` | no |
1919
| log\_export\_storage\_retention\_policy | Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. | <pre>object({<br> is_locked = bool<br> retention_period_days = number<br> })</pre> | `null` | no |
2020
| log\_export\_storage\_versioning | (Optional) Toggles bucket versioning, ability to retain a non-current object version when the live object version gets replaced or deleted. | `bool` | `false` | no |
21-
| project\_budget | Budget configuration for projects.<br> budget\_amount: The amount to use as the budget.<br> alert\_spent\_percents: A list of percentages of the budget to alert on when threshold is exceeded.<br> alert\_pubsub\_topic: The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form of `projects/{project_id}/topics/{topic_id}`.<br> alert\_spend\_basis: The type of basis used to determine if spend has passed the threshold. Possible choices are `CURRENT_SPEND` or `FORECASTED_SPEND` (default). | <pre>object({<br> dns_hub_budget_amount = optional(number, 1000)<br> dns_hub_alert_spent_percents = optional(list(number), [1.2])<br> dns_hub_alert_pubsub_topic = optional(string, null)<br> dns_hub_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> base_net_hub_budget_amount = optional(number, 1000)<br> base_net_hub_alert_spent_percents = optional(list(number), [1.2])<br> base_net_hub_alert_pubsub_topic = optional(string, null)<br> base_net_hub_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> base_network_budget_amount = optional(number, 1000)<br> base_network_alert_spent_percents = optional(list(number), [1.2])<br> base_network_alert_pubsub_topic = optional(string, null)<br> base_network_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> restricted_net_hub_budget_amount = optional(number, 1000)<br> restricted_net_hub_alert_spent_percents = optional(list(number), [1.2])<br> restricted_net_hub_alert_pubsub_topic = optional(string, null)<br> restricted_net_hub_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> restricted_network_budget_amount = optional(number, 1000)<br> restricted_network_alert_spent_percents = optional(list(number), [1.2])<br> restricted_network_alert_pubsub_topic = optional(string, null)<br> restricted_network_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> interconnect_budget_amount = optional(number, 1000)<br> interconnect_alert_spent_percents = optional(list(number), [1.2])<br> interconnect_alert_pubsub_topic = optional(string, null)<br> interconnect_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> org_secrets_budget_amount = optional(number, 1000)<br> org_secrets_alert_spent_percents = optional(list(number), [1.2])<br> org_secrets_alert_pubsub_topic = optional(string, null)<br> org_secrets_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> org_billing_export_budget_amount = optional(number, 1000)<br> org_billing_export_alert_spent_percents = optional(list(number), [1.2])<br> org_billing_export_alert_pubsub_topic = optional(string, null)<br> org_billing_export_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> org_audit_logs_budget_amount = optional(number, 1000)<br> org_audit_logs_alert_spent_percents = optional(list(number), [1.2])<br> org_audit_logs_alert_pubsub_topic = optional(string, null)<br> org_audit_logs_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> common_kms_budget_amount = optional(number, 1000)<br> common_kms_alert_spent_percents = optional(list(number), [1.2])<br> common_kms_alert_pubsub_topic = optional(string, null)<br> common_kms_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> scc_notifications_budget_amount = optional(number, 1000)<br> scc_notifications_alert_spent_percents = optional(list(number), [1.2])<br> scc_notifications_alert_pubsub_topic = optional(string, null)<br> scc_notifications_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> })</pre> | `{}` | no |
21+
| project\_budget | Budget configuration for projects.<br> budget\_amount: The amount to use as the budget.<br> alert\_spent\_percents: A list of percentages of the budget to alert on when threshold is exceeded.<br> alert\_pubsub\_topic: The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form of `projects/{project_id}/topics/{topic_id}`.<br> alert\_spend\_basis: The type of basis used to determine if spend has passed the threshold. Possible choices are `CURRENT_SPEND` or `FORECASTED_SPEND` (default). | <pre>object({<br> base_net_hub_budget_amount = optional(number, 1000)<br> base_net_hub_alert_spent_percents = optional(list(number), [1.2])<br> base_net_hub_alert_pubsub_topic = optional(string, null)<br> base_net_hub_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> base_network_budget_amount = optional(number, 1000)<br> base_network_alert_spent_percents = optional(list(number), [1.2])<br> base_network_alert_pubsub_topic = optional(string, null)<br> base_network_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> restricted_net_hub_budget_amount = optional(number, 1000)<br> restricted_net_hub_alert_spent_percents = optional(list(number), [1.2])<br> restricted_net_hub_alert_pubsub_topic = optional(string, null)<br> restricted_net_hub_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> restricted_network_budget_amount = optional(number, 1000)<br> restricted_network_alert_spent_percents = optional(list(number), [1.2])<br> restricted_network_alert_pubsub_topic = optional(string, null)<br> restricted_network_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> interconnect_budget_amount = optional(number, 1000)<br> interconnect_alert_spent_percents = optional(list(number), [1.2])<br> interconnect_alert_pubsub_topic = optional(string, null)<br> interconnect_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> org_secrets_budget_amount = optional(number, 1000)<br> org_secrets_alert_spent_percents = optional(list(number), [1.2])<br> org_secrets_alert_pubsub_topic = optional(string, null)<br> org_secrets_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> org_billing_export_budget_amount = optional(number, 1000)<br> org_billing_export_alert_spent_percents = optional(list(number), [1.2])<br> org_billing_export_alert_pubsub_topic = optional(string, null)<br> org_billing_export_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> org_audit_logs_budget_amount = optional(number, 1000)<br> org_audit_logs_alert_spent_percents = optional(list(number), [1.2])<br> org_audit_logs_alert_pubsub_topic = optional(string, null)<br> org_audit_logs_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> common_kms_budget_amount = optional(number, 1000)<br> common_kms_alert_spent_percents = optional(list(number), [1.2])<br> common_kms_alert_pubsub_topic = optional(string, null)<br> common_kms_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> scc_notifications_budget_amount = optional(number, 1000)<br> scc_notifications_alert_spent_percents = optional(list(number), [1.2])<br> scc_notifications_alert_pubsub_topic = optional(string, null)<br> scc_notifications_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")<br> })</pre> | `{}` | no |
2222
| project\_deletion\_policy | The deletion policy for the project created. | `string` | `"PREVENT"` | no |
2323
| remote\_state\_bucket | Backend bucket to load Terraform Remote State Data from previous steps. | `string` | n/a | yes |
2424
| scc\_notification\_filter | Filter used to create the Security Command Center Notification, you can see more details on how to create filters in https://cloud.google.com/security-command-center/docs/how-to-api-filter-notifications#create-filter | `string` | `"state = \"ACTIVE\""` | no |
@@ -37,7 +37,6 @@
3737
| cai\_monitoring\_topic | CAI Monitoring Cloud Function Pub/Sub Topic name. |
3838
| common\_folder\_name | The common folder name |
3939
| common\_kms\_project\_id | The org Cloud Key Management Service (KMS) project ID |
40-
| dns\_hub\_project\_id | The DNS hub project ID |
4140
| domains\_to\_allow | The list of domains to allow users from in IAM. |
4241
| interconnect\_project\_id | The Dedicated Interconnect project ID |
4342
| interconnect\_project\_number | The Dedicated Interconnect project number |

1-org/envs/shared/outputs.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ output "scc_notifications_project_id" {
7979
description = "The SCC notifications project ID"
8080
}
8181

82-
output "dns_hub_project_id" {
83-
value = module.dns_hub.project_id
84-
description = "The DNS hub project ID"
85-
}
86-
8782
output "base_net_hub_project_id" {
8883
value = try(module.base_network_hub[0].project_id, null)
8984
description = "The Base Network hub project ID"

1-org/envs/shared/projects.tf

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -233,48 +233,6 @@ module "scc_notifications" {
233233
budget_alert_spend_basis = var.project_budget.scc_notifications_budget_alert_spend_basis
234234
}
235235

236-
/******************************************
237-
Project for DNS Hub
238-
*****************************************/
239-
240-
module "dns_hub" {
241-
source = "terraform-google-modules/project-factory/google"
242-
version = "~> 18.0"
243-
244-
random_project_id = true
245-
random_project_id_length = 4
246-
default_service_account = "deprivilege"
247-
name = "${local.project_prefix}-net-dns"
248-
org_id = local.org_id
249-
billing_account = local.billing_account
250-
folder_id = google_folder.network.id
251-
deletion_policy = var.project_deletion_policy
252-
253-
activate_apis = [
254-
"compute.googleapis.com",
255-
"dns.googleapis.com",
256-
"servicenetworking.googleapis.com",
257-
"logging.googleapis.com",
258-
"cloudresourcemanager.googleapis.com",
259-
"billingbudgets.googleapis.com"
260-
]
261-
262-
labels = {
263-
environment = "network"
264-
application_name = "org-dns-hub"
265-
billing_code = "1234"
266-
primary_contact = "example1"
267-
secondary_contact = "example2"
268-
business_code = "shared"
269-
env_code = "net"
270-
vpc = "none"
271-
}
272-
budget_alert_pubsub_topic = var.project_budget.dns_hub_alert_pubsub_topic
273-
budget_alert_spent_percents = var.project_budget.dns_hub_alert_spent_percents
274-
budget_amount = var.project_budget.dns_hub_budget_amount
275-
budget_alert_spend_basis = var.project_budget.dns_hub_budget_alert_spend_basis
276-
}
277-
278236
/******************************************
279237
Project for Base Network Hub
280238
*****************************************/

1-org/envs/shared/variables.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ variable "project_budget" {
9797
alert_spend_basis: The type of basis used to determine if spend has passed the threshold. Possible choices are `CURRENT_SPEND` or `FORECASTED_SPEND` (default).
9898
EOT
9999
type = object({
100-
dns_hub_budget_amount = optional(number, 1000)
101-
dns_hub_alert_spent_percents = optional(list(number), [1.2])
102-
dns_hub_alert_pubsub_topic = optional(string, null)
103-
dns_hub_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")
104100
base_net_hub_budget_amount = optional(number, 1000)
105101
base_net_hub_alert_spent_percents = optional(list(number), [1.2])
106102
base_net_hub_alert_pubsub_topic = optional(string, null)

0 commit comments

Comments
 (0)