Skip to content
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7f3dbcf
DNS Refactory for hub-and-spoke
renato-rudnicki Nov 1, 2024
20fd603
remove dns-hub.tf
renato-rudnicki Nov 4, 2024
5ee619b
remove dns_hub code
renato-rudnicki Nov 6, 2024
7f6644d
fix lint and module names
renato-rudnicki Nov 6, 2024
b6e1cf8
change conditional for advertised_ip_ranges
renato-rudnicki Nov 6, 2024
b6810c7
Merge branch 'master' into dns-refactory
renato-rudnicki Nov 7, 2024
573bdf4
removing dns_hub_project_id references
renato-rudnicki Nov 12, 2024
62274d7
fix project for vpc_dns_hub
renato-rudnicki Nov 14, 2024
e39a508
fix base_shared project value
renato-rudnicki Nov 14, 2024
8306009
fix shared network
renato-rudnicki Nov 21, 2024
f7c4d14
fix advertised_ip_ranges
renato-rudnicki Nov 27, 2024
04dbfcc
change advertised_ip_ranges to local advertised_ip
renato-rudnicki Dec 6, 2024
b27c513
remove target_name_server_addresses from dev/prod/nonprod
renato-rudnicki Dec 6, 2024
770b957
remove dns-hub from dual_shared_vpc
renato-rudnicki Dec 12, 2024
71eda88
DNS Forward for dual-shared-vpc
renato-rudnicki Dec 13, 2024
576a942
dual-shared-vpc-changes
renato-rudnicki Dec 19, 2024
d92c5ce
fix lint
renato-rudnicki Dec 19, 2024
cc17b6a
refactoy DNS Dual-Shared
renato-rudnicki Dec 20, 2024
30000d3
Merge branch 'master' into dns-refactory
renato-rudnicki Dec 26, 2024
e9867b6
remove comments and update code
renato-rudnicki Dec 26, 2024
1557bd0
Changes related to PR review
renato-rudnicki Dec 27, 2024
7b3b67f
Merge branch 'master' into dns-refactory
renato-rudnicki Jan 2, 2025
5941cdf
add symbolic link
renato-rudnicki Jan 8, 2025
dbe4c6e
Merge branch 'main' into network-dns-refactory
amandakarina Jan 9, 2025
0ed0b0a
fix integration tests and remove DNS Hub Project
renato-rudnicki Jan 9, 2025
b73d165
Rollback func getFirewallMode
renato-rudnicki Jan 9, 2025
488ced4
remove TestShared from int.cloudbuild.yaml
renato-rudnicki Jan 10, 2025
f102fc9
Merge branch 'terraform-google-modules:main' into network-dns-refactory
renato-rudnicki Jan 10, 2025
dd5c5f2
fix integration test for DNS
renato-rudnicki Jan 10, 2025
caf0102
disable shared function
renato-rudnicki Jan 13, 2025
10c4f95
add .tfvars files in TestNetwork
renato-rudnicki Jan 14, 2025
25335d5
rename variables and small fixes
renato-rudnicki Jan 17, 2025
bc3c6c8
fix advertised_ip value
renato-rudnicki Jan 17, 2025
49453c7
fix lint
renato-rudnicki Jan 17, 2025
027fa28
update integration tests
renato-rudnicki Jan 30, 2025
32afc3e
update dual-shared
renato-rudnicki Jan 30, 2025
15d95a6
fix dual-svpc integration test
renato-rudnicki Jan 31, 2025
c79dd07
fix lint
renato-rudnicki Jan 31, 2025
62d908c
change array order for network test
renato-rudnicki Feb 3, 2025
11bf750
update integration tests for helper
renato-rudnicki Feb 5, 2025
42e8202
fix for helper deployer
renato-rudnicki Feb 6, 2025
72481b0
fix for apply.go
renato-rudnicki Feb 7, 2025
2035566
fix for help deployer
renato-rudnicki Feb 12, 2025
5077d75
update README instructions
renato-rudnicki Feb 12, 2025
cb95c1c
PR small fixes
renato-rudnicki Feb 18, 2025
7eb6554
removing t.parallel
renato-rudnicki Feb 19, 2025
c386a98
fix integration tests
renato-rudnicki Feb 25, 2025
7995aa7
adds retry for create service networking connection error
renato-rudnicki Feb 26, 2025
0d9272a
fix retries exceeded on 1-org destroy step
renato-rudnicki Feb 28, 2025
bc2f8ee
Merge branch 'main' into network-dns-refactory
renato-rudnicki Mar 1, 2025
80edbb7
Merge branch 'main' into network-dns-refactory
renato-rudnicki Mar 5, 2025
8a2d7a2
fix validation for dns test
renato-rudnicki Mar 5, 2025
8909aaa
fix conflicts
renato-rudnicki Mar 7, 2025
1624e1c
fix correct order for network destroy step
renato-rudnicki Mar 7, 2025
534f9bf
remove dns_hub module
renato-rudnicki Mar 7, 2025
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
6 changes: 3 additions & 3 deletions 0-bootstrap/README-GitHub.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,15 +565,15 @@ or go to [Deploying step 3-networks-hub-and-spoke](#deploying-step-3-networks-hu
chmod 755 ./tf-wrapper.sh
```

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`.
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`.

```bash
mv common.auto.example.tfvars common.auto.tfvars
mv shared.auto.example.tfvars shared.auto.tfvars
mv production.auto.example.tfvars production.auto.tfvars
mv access_context.auto.example.tfvars access_context.auto.tfvars
```

1. Update the file `shared.auto.tfvars` with the values for the `target_name_server_addresses`.
1. Update the file `production.auto.tfvars` with the values for the `target_name_server_addresses`.
1. Update the file `access_context.auto.tfvars` with the organization's `access_context_manager_policy_id`.

```bash
Expand Down
6 changes: 3 additions & 3 deletions 0-bootstrap/README-GitLab.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,15 +568,15 @@ or go to [Deploying step 3-networks-hub-and-spoke](#deploying-step-3-networks-hu
chmod 755 ./*.sh
```

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`.
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`.

```bash
mv common.auto.example.tfvars common.auto.tfvars
mv shared.auto.example.tfvars shared.auto.tfvars
mv production.auto.example.tfvars production.auto.tfvars
mv access_context.auto.example.tfvars access_context.auto.tfvars
```

1. Update the file `shared.auto.tfvars` with the values for the `target_name_server_addresses`.
1. Update the file `production.auto.tfvars` with the values for the `target_name_server_addresses`.
1. Update the file `access_context.auto.tfvars` with the organization's `access_context_manager_policy_id`.

```bash
Expand Down
6 changes: 3 additions & 3 deletions 0-bootstrap/README-Jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,16 +599,16 @@ Here you will configure a VPN Network tunnel to enable connectivity between the
sed -i'' -e "s/CICD_PROJECT_ID/${CICD_PROJECT_ID}/" ./Jenkinsfile
```

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`.
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`.

```bash
mv common.auto.example.tfvars common.auto.tfvars
mv shared.auto.example.tfvars shared.auto.tfvars
mv production.auto.example.tfvars production.auto.tfvars
mv access_context.auto.example.tfvars access_context.auto.tfvars
```

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.
1. Update `shared.auto.tfvars` file with the `target_name_server_addresses`.
1. Update `production.auto.tfvars` file with the `target_name_server_addresses`.
1. Update `access_context.auto.tfvars` file with the `access_context_manager_policy_id`.
1. Use `terraform output` to get the backend bucket and networks step Terraform Service Account values from gcp-bootstrap output.

Expand Down
6 changes: 3 additions & 3 deletions 0-bootstrap/README-Terraform-Cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,15 +476,15 @@ or go to [Deploying step 3-networks-hub-and-spoke](#deploying-step-3-networks-hu
chmod 755 ./tf-wrapper.sh
```

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`.
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`.

```bash
mv common.auto.example.tfvars common.auto.tfvars
mv shared.auto.example.tfvars shared.auto.tfvars
mv production.auto.example.tfvars production.auto.tfvars
mv access_context.auto.example.tfvars access_context.auto.tfvars
```

1. Update the file `shared.auto.tfvars` with the values for the `target_name_server_addresses`.
1. Update the file `production.auto.tfvars` with the values for the `target_name_server_addresses`.
1. Update the file `access_context.auto.tfvars` with the organization's `access_context_manager_policy_id`.

```bash
Expand Down
3 changes: 1 addition & 2 deletions 1-org/envs/shared/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
| log\_export\_storage\_location | The location of the storage bucket used to export logs. | `string` | `null` | no |
| 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 |
| 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 |
| 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 |
| 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 |
| project\_deletion\_policy | The deletion policy for the project created. | `string` | `"PREVENT"` | no |
| remote\_state\_bucket | Backend bucket to load Terraform Remote State Data from previous steps. | `string` | n/a | yes |
| 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 |
Expand All @@ -37,7 +37,6 @@
| cai\_monitoring\_topic | CAI Monitoring Cloud Function Pub/Sub Topic name. |
| common\_folder\_name | The common folder name |
| common\_kms\_project\_id | The org Cloud Key Management Service (KMS) project ID |
| dns\_hub\_project\_id | The DNS hub project ID |
| domains\_to\_allow | The list of domains to allow users from in IAM. |
| interconnect\_project\_id | The Dedicated Interconnect project ID |
| interconnect\_project\_number | The Dedicated Interconnect project number |
Expand Down
5 changes: 0 additions & 5 deletions 1-org/envs/shared/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ output "scc_notifications_project_id" {
description = "The SCC notifications project ID"
}

output "dns_hub_project_id" {
value = module.dns_hub.project_id
description = "The DNS hub project ID"
}

output "base_net_hub_project_id" {
value = try(module.base_network_hub[0].project_id, null)
description = "The Base Network hub project ID"
Expand Down
42 changes: 0 additions & 42 deletions 1-org/envs/shared/projects.tf
Original file line number Diff line number Diff line change
Expand Up @@ -233,48 +233,6 @@ module "scc_notifications" {
budget_alert_spend_basis = var.project_budget.scc_notifications_budget_alert_spend_basis
}

/******************************************
Project for DNS Hub
*****************************************/

module "dns_hub" {
source = "terraform-google-modules/project-factory/google"
version = "~> 17.0"

random_project_id = true
random_project_id_length = 4
default_service_account = "deprivilege"
name = "${local.project_prefix}-net-dns"
org_id = local.org_id
billing_account = local.billing_account
folder_id = google_folder.network.id
deletion_policy = var.project_deletion_policy

activate_apis = [
"compute.googleapis.com",
"dns.googleapis.com",
"servicenetworking.googleapis.com",
"logging.googleapis.com",
"cloudresourcemanager.googleapis.com",
"billingbudgets.googleapis.com"
]

labels = {
environment = "network"
application_name = "org-dns-hub"
billing_code = "1234"
primary_contact = "example1"
secondary_contact = "example2"
business_code = "shared"
env_code = "net"
vpc = "none"
}
budget_alert_pubsub_topic = var.project_budget.dns_hub_alert_pubsub_topic
budget_alert_spent_percents = var.project_budget.dns_hub_alert_spent_percents
budget_amount = var.project_budget.dns_hub_budget_amount
budget_alert_spend_basis = var.project_budget.dns_hub_budget_alert_spend_basis
}

/******************************************
Project for Base Network Hub
*****************************************/
Expand Down
4 changes: 0 additions & 4 deletions 1-org/envs/shared/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ variable "project_budget" {
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).
EOT
type = object({
dns_hub_budget_amount = optional(number, 1000)
dns_hub_alert_spent_percents = optional(list(number), [1.2])
dns_hub_alert_pubsub_topic = optional(string, null)
dns_hub_budget_alert_spend_basis = optional(string, "FORECASTED_SPEND")
base_net_hub_budget_amount = optional(number, 1000)
base_net_hub_alert_spent_percents = optional(list(number), [1.2])
base_net_hub_alert_pubsub_topic = optional(string, null)
Expand Down
Loading