diff --git a/0-bootstrap/README-GitHub.md b/0-bootstrap/README-GitHub.md index dfa1390ca..5a4472dff 100644 --- a/0-bootstrap/README-GitHub.md +++ b/0-bootstrap/README-GitHub.md @@ -823,6 +823,8 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th cd gcp-projects ``` + + 1. Seed the repository if it has not been initialized yet. ```bash @@ -878,6 +880,20 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th sed -i'' -e "s/REMOTE_STATE_BUCKET/${remote_state_bucket}/" ./common.auto.tfvars ``` +1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`. + +For example, to create a new business unit similar to business_unit_1, run the following: + + ```bash + #copy the business_unit_1 folder and it's contents to a new folder business_unit_2 + cp -r business_unit_1 business_unit_2 + + # search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2 + grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g' + grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g' + ``` + + 1. Commit changes. ```bash diff --git a/0-bootstrap/README-GitLab.md b/0-bootstrap/README-GitLab.md index 96f066a74..862bade17 100644 --- a/0-bootstrap/README-GitLab.md +++ b/0-bootstrap/README-GitLab.md @@ -837,6 +837,20 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th sed -i'' -e "s/REMOTE_STATE_BUCKET/${remote_state_bucket}/" ./common.auto.tfvars ``` +1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`. + +For example, to create a new business unit similar to business_unit_1, run the following: + + ```bash + #copy the business_unit_1 folder and it's contents to a new folder business_unit_2 + cp -r business_unit_1 business_unit_2 + + # search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2 + grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g' + grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g' + ``` + + 1. Commit changes. ```bash diff --git a/0-bootstrap/README-Jenkins.md b/0-bootstrap/README-Jenkins.md index 469e25694..688772522 100644 --- a/0-bootstrap/README-Jenkins.md +++ b/0-bootstrap/README-Jenkins.md @@ -886,6 +886,20 @@ Here you will configure a VPN Network tunnel to enable connectivity between the sed -i'' -e "s/REMOTE_STATE_BUCKET/${backend_bucket}/" ./common.auto.tfvars ``` +1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`. + +For example, to create a new business unit similar to business_unit_1, run the following: + + ```bash + #copy the business_unit_1 folder and it's contents to a new folder business_unit_2 + cp -r business_unit_1 business_unit_2 + + # search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2 + grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g' + grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g' + ``` + + 1. Commit changes. ```bash diff --git a/0-bootstrap/README-Terraform-Cloud.md b/0-bootstrap/README-Terraform-Cloud.md index 256ae2446..0239aa984 100644 --- a/0-bootstrap/README-Terraform-Cloud.md +++ b/0-bootstrap/README-Terraform-Cloud.md @@ -862,6 +862,20 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th terraform -chdir="business_unit_2/shared/" init ``` +1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`. + +For example, to create a new business unit similar to business_unit_1, run the following: + + ```bash + #copy the business_unit_1 folder and it's contents to a new folder business_unit_2 + cp -r business_unit_1 business_unit_2 + + # search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2 + grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g' + grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g' + ``` + + 1. Commit changes ```bash diff --git a/4-projects/README.md b/4-projects/README.md index f1653070d..cd2c517dc 100644 --- a/4-projects/README.md +++ b/4-projects/README.md @@ -134,6 +134,20 @@ Run `terraform output cloudbuild_project_id` in the `0-bootstrap` folder to get sed -i'' -e "s/REMOTE_STATE_BUCKET/${remote_state_bucket}/" ./common.auto.tfvars ``` +1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`. + +For example, to create a new business unit similar to business_unit_1, run the following: + + ```bash + #copy the business_unit_1 folder and it's contents to a new folder business_unit_2 + cp -r business_unit_1 business_unit_2 + + # search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2 + grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g' + grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g' + ``` + + 1. Commit changes. ```bash @@ -268,6 +282,20 @@ To use the `validate` option of the `tf-wrapper.sh` script, please follow the [i echo ${GOOGLE_IMPERSONATE_SERVICE_ACCOUNT} ``` +1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`. + +For example, to create a new business unit similar to business_unit_1, run the following: + + ```bash + #copy the business_unit_1 folder and it's contents to a new folder business_unit_2 + cp -r business_unit_1 business_unit_2 + + # search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2 + grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g' + grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g' + ``` + + 1. Run `init` and `plan` and review output for environment shared. ```bash diff --git a/4-projects/business_unit_2/development/README.md b/4-projects/business_unit_2/development/README.md deleted file mode 100644 index b6841087a..000000000 --- a/4-projects/business_unit_2/development/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| instance\_region | Region which the peered subnet will be created (Should be same region as the VM that will be created on step 5-app-infra on the peering project). | `string` | `"us-central1"` | no | -| location\_gcs | Case-Sensitive Location for GCS Bucket (Should be same region as the KMS Keyring) | `string` | `"US"` | no | -| location\_kms | Case-Sensitive Location for KMS Keyring (Should be same region as the GCS Bucket) | `string` | `"us"` | no | -| peering\_module\_depends\_on | List of modules or resources peering module depends on. | `list(any)` | `[]` | no | -| remote\_state\_bucket | Backend bucket to load Terraform Remote State Data from previous steps. | `string` | n/a | yes | -| tfc\_org\_name | Name of the TFC organization. | `string` | `""` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| access\_context\_manager\_policy\_id | Access Context Manager Policy ID. | -| base\_shared\_vpc\_project | Project sample base project. | -| base\_shared\_vpc\_project\_sa | Project sample base project SA. | -| base\_subnets\_self\_links | The self-links of subnets from base environment. | -| bucket | The created storage bucket. | -| env\_kms\_project | Project sample for KMS usage project ID. | -| floating\_project | Project sample floating project. | -| iap\_firewall\_tags | The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project. | -| keyring | The name of the keyring. | -| keys | List of created key names. | -| peering\_complete | Output to be used as a module dependency. | -| peering\_network | Peer network peering resource. | -| peering\_project | Project sample peering project id. | -| peering\_subnetwork\_self\_link | The subnetwork self link of the peering network. | -| restricted\_enabled\_apis | Activated APIs. | -| restricted\_shared\_vpc\_project | Project sample restricted project id. | -| restricted\_shared\_vpc\_project\_number | Project sample restricted project. | -| restricted\_subnets\_self\_links | The self-links of subnets from restricted environment. | -| vpc\_service\_control\_perimeter\_name | VPC Service Control name. | - - diff --git a/4-projects/business_unit_2/development/backend.tf b/4-projects/business_unit_2/development/backend.tf deleted file mode 100644 index 1505fcecf..000000000 --- a/4-projects/business_unit_2/development/backend.tf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -terraform { - backend "gcs" { - bucket = "UPDATE_PROJECTS_BACKEND" - prefix = "terraform/projects/business_unit_2/development" - } -} diff --git a/4-projects/business_unit_2/development/backend.tf.cloud.example b/4-projects/business_unit_2/development/backend.tf.cloud.example deleted file mode 100644 index f1893f851..000000000 --- a/4-projects/business_unit_2/development/backend.tf.cloud.example +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -terraform { - cloud { - workspaces { - name = "4-bu2-development" - } - } -} diff --git a/4-projects/business_unit_2/development/common.auto.tfvars b/4-projects/business_unit_2/development/common.auto.tfvars deleted file mode 120000 index 39aaa4621..000000000 --- a/4-projects/business_unit_2/development/common.auto.tfvars +++ /dev/null @@ -1 +0,0 @@ -../../common.auto.tfvars \ No newline at end of file diff --git a/4-projects/business_unit_2/development/development.auto.tfvars b/4-projects/business_unit_2/development/development.auto.tfvars deleted file mode 120000 index 0351835de..000000000 --- a/4-projects/business_unit_2/development/development.auto.tfvars +++ /dev/null @@ -1 +0,0 @@ -../../development.auto.tfvars \ No newline at end of file diff --git a/4-projects/business_unit_2/development/main.tf b/4-projects/business_unit_2/development/main.tf deleted file mode 100644 index caf741ec0..000000000 --- a/4-projects/business_unit_2/development/main.tf +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module "env" { - source = "../../modules/base_env" - - env = "development" - business_code = "bu2" - business_unit = "business_unit_2" - remote_state_bucket = var.remote_state_bucket - location_kms = var.location_kms - location_gcs = var.location_gcs - tfc_org_name = var.tfc_org_name - peering_module_depends_on = var.peering_module_depends_on - peering_iap_fw_rules_enabled = true - subnet_region = var.instance_region - subnet_ip_range = "10.4.64.0/21" -} diff --git a/4-projects/business_unit_2/development/outputs.tf b/4-projects/business_unit_2/development/outputs.tf deleted file mode 100644 index 6f07af601..000000000 --- a/4-projects/business_unit_2/development/outputs.tf +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -output "base_shared_vpc_project" { - description = "Project sample base project." - value = module.env.base_shared_vpc_project -} - -output "base_shared_vpc_project_sa" { - description = "Project sample base project SA." - value = module.env.base_shared_vpc_project_sa -} - -output "base_subnets_self_links" { - value = module.env.base_subnets_self_links - description = "The self-links of subnets from base environment." -} - -output "floating_project" { - description = "Project sample floating project." - value = module.env.floating_project -} - -output "peering_project" { - description = "Project sample peering project id." - value = module.env.peering_project -} - -output "peering_network" { - description = "Peer network peering resource." - value = module.env.peering_network -} - -output "restricted_shared_vpc_project" { - description = "Project sample restricted project id." - value = module.env.restricted_shared_vpc_project -} - -output "restricted_shared_vpc_project_number" { - description = "Project sample restricted project." - value = module.env.restricted_shared_vpc_project_number -} - -output "restricted_subnets_self_links" { - value = module.env.restricted_subnets_self_links - description = "The self-links of subnets from restricted environment." -} - -output "vpc_service_control_perimeter_name" { - description = "VPC Service Control name." - value = module.env.vpc_service_control_perimeter_name -} - -output "restricted_enabled_apis" { - description = "Activated APIs." - value = module.env.restricted_enabled_apis -} - -output "access_context_manager_policy_id" { - description = "Access Context Manager Policy ID." - value = module.env.access_context_manager_policy_id -} - -output "peering_complete" { - description = "Output to be used as a module dependency." - value = module.env.peering_complete -} - -output "env_kms_project" { - description = "Project sample for KMS usage project ID." - value = module.env.env_kms_project -} - -output "keyring" { - description = "The name of the keyring." - value = module.env.keyring -} - -output "keys" { - description = "List of created key names." - value = module.env.keys -} - -output "bucket" { - description = "The created storage bucket." - value = module.env.bucket -} - -output "peering_subnetwork_self_link" { - description = "The subnetwork self link of the peering network." - value = module.env.peering_subnetwork_self_link -} - -output "iap_firewall_tags" { - description = "The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project." - value = module.env.iap_firewall_tags -} diff --git a/4-projects/business_unit_2/development/variables.tf b/4-projects/business_unit_2/development/variables.tf deleted file mode 100644 index b337bae90..000000000 --- a/4-projects/business_unit_2/development/variables.tf +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -variable "remote_state_bucket" { - description = "Backend bucket to load Terraform Remote State Data from previous steps." - type = string -} - -variable "location_kms" { - description = "Case-Sensitive Location for KMS Keyring (Should be same region as the GCS Bucket)" - type = string - default = "us" -} - -variable "location_gcs" { - description = "Case-Sensitive Location for GCS Bucket (Should be same region as the KMS Keyring)" - type = string - default = "US" -} - -variable "peering_module_depends_on" { - description = "List of modules or resources peering module depends on." - type = list(any) - default = [] -} - -variable "tfc_org_name" { - description = "Name of the TFC organization." - type = string - default = "" -} - -variable "instance_region" { - description = "Region which the peered subnet will be created (Should be same region as the VM that will be created on step 5-app-infra on the peering project)." - type = string - default = "us-central1" -} diff --git a/4-projects/business_unit_2/nonproduction/README.md b/4-projects/business_unit_2/nonproduction/README.md deleted file mode 100644 index bb68bcc2d..000000000 --- a/4-projects/business_unit_2/nonproduction/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| instance\_region | Region which the peered subnet will be created (Should be same region as the VM that will be created on step 5-app-infra on the peering project). | `string` | `"us-central1"` | no | -| location\_gcs | Case-Sensitive Location for GCS Bucket (Should be same region as the KMS Keyring) | `string` | `"US"` | no | -| location\_kms | Case-Sensitive Location for KMS Keyring (Should be same region as the GCS Bucket) | `string` | `"us"` | no | -| peering\_module\_depends\_on | List of modules or resources peering module depends on. | `list(any)` | `[]` | no | -| remote\_state\_bucket | Backend bucket to load Terraform Remote State Data from previous steps. | `string` | n/a | yes | -| tfc\_org\_name | Name of the TFC organization | `string` | `""` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| access\_context\_manager\_policy\_id | Access Context Manager Policy ID. | -| base\_shared\_vpc\_project | Project sample base project. | -| base\_shared\_vpc\_project\_sa | Project sample base project SA. | -| base\_subnets\_self\_links | The self-links of subnets from base environment. | -| bucket | The created storage bucket. | -| env\_kms\_project | Project sample for KMS usage project ID. | -| floating\_project | Project sample floating project. | -| iap\_firewall\_tags | The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project. | -| keyring | The name of the keyring. | -| keys | List of created key names. | -| peering\_complete | Output to be used as a module dependency. | -| peering\_network | Peer network peering resource. | -| peering\_project | Project sample peering project id. | -| peering\_subnetwork\_self\_link | The subnetwork self link of the peering network. | -| restricted\_enabled\_apis | Activated APIs. | -| restricted\_shared\_vpc\_project | Project sample restricted project id. | -| restricted\_shared\_vpc\_project\_number | Project sample restricted project. | -| restricted\_subnets\_self\_links | The self-links of subnets from restricted environment. | -| vpc\_service\_control\_perimeter\_name | VPC Service Control name. | - - diff --git a/4-projects/business_unit_2/nonproduction/backend.tf b/4-projects/business_unit_2/nonproduction/backend.tf deleted file mode 100644 index 8d75824f7..000000000 --- a/4-projects/business_unit_2/nonproduction/backend.tf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -terraform { - backend "gcs" { - bucket = "UPDATE_PROJECTS_BACKEND" - prefix = "terraform/projects/business_unit_2/nonproduction" - } -} diff --git a/4-projects/business_unit_2/nonproduction/backend.tf.cloud.example b/4-projects/business_unit_2/nonproduction/backend.tf.cloud.example deleted file mode 100644 index f6921e66f..000000000 --- a/4-projects/business_unit_2/nonproduction/backend.tf.cloud.example +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -terraform { - cloud { - workspaces { - name = "4-bu2-nonproduction" - } - } -} diff --git a/4-projects/business_unit_2/nonproduction/common.auto.tfvars b/4-projects/business_unit_2/nonproduction/common.auto.tfvars deleted file mode 120000 index 39aaa4621..000000000 --- a/4-projects/business_unit_2/nonproduction/common.auto.tfvars +++ /dev/null @@ -1 +0,0 @@ -../../common.auto.tfvars \ No newline at end of file diff --git a/4-projects/business_unit_2/nonproduction/main.tf b/4-projects/business_unit_2/nonproduction/main.tf deleted file mode 100644 index ab1570069..000000000 --- a/4-projects/business_unit_2/nonproduction/main.tf +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module "env" { - source = "../../modules/base_env" - - env = "nonproduction" - business_code = "bu2" - business_unit = "business_unit_2" - remote_state_bucket = var.remote_state_bucket - location_kms = var.location_kms - location_gcs = var.location_gcs - tfc_org_name = var.tfc_org_name - peering_module_depends_on = var.peering_module_depends_on - peering_iap_fw_rules_enabled = true - subnet_region = var.instance_region - subnet_ip_range = "10.4.128.0/21" -} diff --git a/4-projects/business_unit_2/nonproduction/nonproduction.auto.tfvars b/4-projects/business_unit_2/nonproduction/nonproduction.auto.tfvars deleted file mode 120000 index d2ffd5e85..000000000 --- a/4-projects/business_unit_2/nonproduction/nonproduction.auto.tfvars +++ /dev/null @@ -1 +0,0 @@ -../../nonproduction.auto.tfvars \ No newline at end of file diff --git a/4-projects/business_unit_2/nonproduction/outputs.tf b/4-projects/business_unit_2/nonproduction/outputs.tf deleted file mode 100644 index 6f07af601..000000000 --- a/4-projects/business_unit_2/nonproduction/outputs.tf +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -output "base_shared_vpc_project" { - description = "Project sample base project." - value = module.env.base_shared_vpc_project -} - -output "base_shared_vpc_project_sa" { - description = "Project sample base project SA." - value = module.env.base_shared_vpc_project_sa -} - -output "base_subnets_self_links" { - value = module.env.base_subnets_self_links - description = "The self-links of subnets from base environment." -} - -output "floating_project" { - description = "Project sample floating project." - value = module.env.floating_project -} - -output "peering_project" { - description = "Project sample peering project id." - value = module.env.peering_project -} - -output "peering_network" { - description = "Peer network peering resource." - value = module.env.peering_network -} - -output "restricted_shared_vpc_project" { - description = "Project sample restricted project id." - value = module.env.restricted_shared_vpc_project -} - -output "restricted_shared_vpc_project_number" { - description = "Project sample restricted project." - value = module.env.restricted_shared_vpc_project_number -} - -output "restricted_subnets_self_links" { - value = module.env.restricted_subnets_self_links - description = "The self-links of subnets from restricted environment." -} - -output "vpc_service_control_perimeter_name" { - description = "VPC Service Control name." - value = module.env.vpc_service_control_perimeter_name -} - -output "restricted_enabled_apis" { - description = "Activated APIs." - value = module.env.restricted_enabled_apis -} - -output "access_context_manager_policy_id" { - description = "Access Context Manager Policy ID." - value = module.env.access_context_manager_policy_id -} - -output "peering_complete" { - description = "Output to be used as a module dependency." - value = module.env.peering_complete -} - -output "env_kms_project" { - description = "Project sample for KMS usage project ID." - value = module.env.env_kms_project -} - -output "keyring" { - description = "The name of the keyring." - value = module.env.keyring -} - -output "keys" { - description = "List of created key names." - value = module.env.keys -} - -output "bucket" { - description = "The created storage bucket." - value = module.env.bucket -} - -output "peering_subnetwork_self_link" { - description = "The subnetwork self link of the peering network." - value = module.env.peering_subnetwork_self_link -} - -output "iap_firewall_tags" { - description = "The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project." - value = module.env.iap_firewall_tags -} diff --git a/4-projects/business_unit_2/nonproduction/variables.tf b/4-projects/business_unit_2/nonproduction/variables.tf deleted file mode 100644 index 2cb800af8..000000000 --- a/4-projects/business_unit_2/nonproduction/variables.tf +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -variable "remote_state_bucket" { - description = "Backend bucket to load Terraform Remote State Data from previous steps." - type = string -} - -variable "location_kms" { - description = "Case-Sensitive Location for KMS Keyring (Should be same region as the GCS Bucket)" - type = string - default = "us" -} - -variable "location_gcs" { - description = "Case-Sensitive Location for GCS Bucket (Should be same region as the KMS Keyring)" - type = string - default = "US" -} - -variable "peering_module_depends_on" { - description = "List of modules or resources peering module depends on." - type = list(any) - default = [] -} - -variable "tfc_org_name" { - description = "Name of the TFC organization" - type = string - default = "" -} - -variable "instance_region" { - description = "Region which the peered subnet will be created (Should be same region as the VM that will be created on step 5-app-infra on the peering project)." - type = string - default = "us-central1" -} diff --git a/4-projects/business_unit_2/production/README.md b/4-projects/business_unit_2/production/README.md deleted file mode 100644 index bb68bcc2d..000000000 --- a/4-projects/business_unit_2/production/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| instance\_region | Region which the peered subnet will be created (Should be same region as the VM that will be created on step 5-app-infra on the peering project). | `string` | `"us-central1"` | no | -| location\_gcs | Case-Sensitive Location for GCS Bucket (Should be same region as the KMS Keyring) | `string` | `"US"` | no | -| location\_kms | Case-Sensitive Location for KMS Keyring (Should be same region as the GCS Bucket) | `string` | `"us"` | no | -| peering\_module\_depends\_on | List of modules or resources peering module depends on. | `list(any)` | `[]` | no | -| remote\_state\_bucket | Backend bucket to load Terraform Remote State Data from previous steps. | `string` | n/a | yes | -| tfc\_org\_name | Name of the TFC organization | `string` | `""` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| access\_context\_manager\_policy\_id | Access Context Manager Policy ID. | -| base\_shared\_vpc\_project | Project sample base project. | -| base\_shared\_vpc\_project\_sa | Project sample base project SA. | -| base\_subnets\_self\_links | The self-links of subnets from base environment. | -| bucket | The created storage bucket. | -| env\_kms\_project | Project sample for KMS usage project ID. | -| floating\_project | Project sample floating project. | -| iap\_firewall\_tags | The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project. | -| keyring | The name of the keyring. | -| keys | List of created key names. | -| peering\_complete | Output to be used as a module dependency. | -| peering\_network | Peer network peering resource. | -| peering\_project | Project sample peering project id. | -| peering\_subnetwork\_self\_link | The subnetwork self link of the peering network. | -| restricted\_enabled\_apis | Activated APIs. | -| restricted\_shared\_vpc\_project | Project sample restricted project id. | -| restricted\_shared\_vpc\_project\_number | Project sample restricted project. | -| restricted\_subnets\_self\_links | The self-links of subnets from restricted environment. | -| vpc\_service\_control\_perimeter\_name | VPC Service Control name. | - - diff --git a/4-projects/business_unit_2/production/backend.tf b/4-projects/business_unit_2/production/backend.tf deleted file mode 100644 index 29515ef83..000000000 --- a/4-projects/business_unit_2/production/backend.tf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -terraform { - backend "gcs" { - bucket = "UPDATE_PROJECTS_BACKEND" - prefix = "terraform/projects/business_unit_2/production" - } -} diff --git a/4-projects/business_unit_2/production/backend.tf.cloud.example b/4-projects/business_unit_2/production/backend.tf.cloud.example deleted file mode 100644 index e182845e6..000000000 --- a/4-projects/business_unit_2/production/backend.tf.cloud.example +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -terraform { - cloud { - workspaces { - name = "4-bu2-production" - } - } -} diff --git a/4-projects/business_unit_2/production/common.auto.tfvars b/4-projects/business_unit_2/production/common.auto.tfvars deleted file mode 120000 index 39aaa4621..000000000 --- a/4-projects/business_unit_2/production/common.auto.tfvars +++ /dev/null @@ -1 +0,0 @@ -../../common.auto.tfvars \ No newline at end of file diff --git a/4-projects/business_unit_2/production/main.tf b/4-projects/business_unit_2/production/main.tf deleted file mode 100644 index c0e5fc299..000000000 --- a/4-projects/business_unit_2/production/main.tf +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module "env" { - source = "../../modules/base_env" - - env = "production" - business_code = "bu2" - business_unit = "business_unit_2" - remote_state_bucket = var.remote_state_bucket - location_kms = var.location_kms - location_gcs = var.location_gcs - tfc_org_name = var.tfc_org_name - peering_module_depends_on = var.peering_module_depends_on - peering_iap_fw_rules_enabled = true - subnet_region = var.instance_region - subnet_ip_range = "10.4.192.0/21" -} diff --git a/4-projects/business_unit_2/production/outputs.tf b/4-projects/business_unit_2/production/outputs.tf deleted file mode 100644 index 6f07af601..000000000 --- a/4-projects/business_unit_2/production/outputs.tf +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -output "base_shared_vpc_project" { - description = "Project sample base project." - value = module.env.base_shared_vpc_project -} - -output "base_shared_vpc_project_sa" { - description = "Project sample base project SA." - value = module.env.base_shared_vpc_project_sa -} - -output "base_subnets_self_links" { - value = module.env.base_subnets_self_links - description = "The self-links of subnets from base environment." -} - -output "floating_project" { - description = "Project sample floating project." - value = module.env.floating_project -} - -output "peering_project" { - description = "Project sample peering project id." - value = module.env.peering_project -} - -output "peering_network" { - description = "Peer network peering resource." - value = module.env.peering_network -} - -output "restricted_shared_vpc_project" { - description = "Project sample restricted project id." - value = module.env.restricted_shared_vpc_project -} - -output "restricted_shared_vpc_project_number" { - description = "Project sample restricted project." - value = module.env.restricted_shared_vpc_project_number -} - -output "restricted_subnets_self_links" { - value = module.env.restricted_subnets_self_links - description = "The self-links of subnets from restricted environment." -} - -output "vpc_service_control_perimeter_name" { - description = "VPC Service Control name." - value = module.env.vpc_service_control_perimeter_name -} - -output "restricted_enabled_apis" { - description = "Activated APIs." - value = module.env.restricted_enabled_apis -} - -output "access_context_manager_policy_id" { - description = "Access Context Manager Policy ID." - value = module.env.access_context_manager_policy_id -} - -output "peering_complete" { - description = "Output to be used as a module dependency." - value = module.env.peering_complete -} - -output "env_kms_project" { - description = "Project sample for KMS usage project ID." - value = module.env.env_kms_project -} - -output "keyring" { - description = "The name of the keyring." - value = module.env.keyring -} - -output "keys" { - description = "List of created key names." - value = module.env.keys -} - -output "bucket" { - description = "The created storage bucket." - value = module.env.bucket -} - -output "peering_subnetwork_self_link" { - description = "The subnetwork self link of the peering network." - value = module.env.peering_subnetwork_self_link -} - -output "iap_firewall_tags" { - description = "The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project." - value = module.env.iap_firewall_tags -} diff --git a/4-projects/business_unit_2/production/production.auto.tfvars b/4-projects/business_unit_2/production/production.auto.tfvars deleted file mode 120000 index be31a2edd..000000000 --- a/4-projects/business_unit_2/production/production.auto.tfvars +++ /dev/null @@ -1 +0,0 @@ -../../production.auto.tfvars \ No newline at end of file diff --git a/4-projects/business_unit_2/production/variables.tf b/4-projects/business_unit_2/production/variables.tf deleted file mode 100644 index 2cb800af8..000000000 --- a/4-projects/business_unit_2/production/variables.tf +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -variable "remote_state_bucket" { - description = "Backend bucket to load Terraform Remote State Data from previous steps." - type = string -} - -variable "location_kms" { - description = "Case-Sensitive Location for KMS Keyring (Should be same region as the GCS Bucket)" - type = string - default = "us" -} - -variable "location_gcs" { - description = "Case-Sensitive Location for GCS Bucket (Should be same region as the KMS Keyring)" - type = string - default = "US" -} - -variable "peering_module_depends_on" { - description = "List of modules or resources peering module depends on." - type = list(any) - default = [] -} - -variable "tfc_org_name" { - description = "Name of the TFC organization" - type = string - default = "" -} - -variable "instance_region" { - description = "Region which the peered subnet will be created (Should be same region as the VM that will be created on step 5-app-infra on the peering project)." - type = string - default = "us-central1" -} diff --git a/4-projects/business_unit_2/shared/README.md b/4-projects/business_unit_2/shared/README.md deleted file mode 100644 index 9515329eb..000000000 --- a/4-projects/business_unit_2/shared/README.md +++ /dev/null @@ -1,26 +0,0 @@ - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| default\_region | Default region to create resources where applicable. | `string` | `"us-central1"` | no | -| project\_budget | Budget configuration.
budget\_amount: The amount to use as the budget.
alert\_spent\_percents: A list of percentages of the budget to alert on when threshold is exceeded.
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}`.
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). |
object({
budget_amount = optional(number, 1000)
alert_spent_percents = optional(list(number), [1.2])
alert_pubsub_topic = optional(string, null)
alert_spend_basis = optional(string, "FORECASTED_SPEND")
})
| `{}` | no | -| remote\_state\_bucket | Backend bucket to load Terraform Remote State Data from previous steps. | `string` | n/a | yes | -| tfc\_org\_name | Name of the TFC organization | `string` | `""` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| apply\_triggers\_id | CB apply triggers | -| artifact\_buckets | GCS Buckets to store Cloud Build Artifacts | -| cloudbuild\_project\_id | n/a | -| default\_region | Default region to create resources where applicable. | -| enable\_cloudbuild\_deploy | Enable infra deployment using Cloud Build. | -| log\_buckets | GCS Buckets to store Cloud Build logs | -| plan\_triggers\_id | CB plan triggers | -| repos | CSRs to store source code | -| state\_buckets | GCS Buckets to store TF state | -| terraform\_service\_accounts | APP Infra Pipeline Terraform Accounts. | - - diff --git a/4-projects/business_unit_2/shared/backend.tf b/4-projects/business_unit_2/shared/backend.tf deleted file mode 100644 index 42d41b40c..000000000 --- a/4-projects/business_unit_2/shared/backend.tf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -terraform { - backend "gcs" { - bucket = "UPDATE_PROJECTS_BACKEND" - prefix = "terraform/projects/business_unit_2/shared" - } -} diff --git a/4-projects/business_unit_2/shared/backend.tf.cloud.example b/4-projects/business_unit_2/shared/backend.tf.cloud.example deleted file mode 100644 index 5dfb05be0..000000000 --- a/4-projects/business_unit_2/shared/backend.tf.cloud.example +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -terraform { - cloud { - workspaces { - name = "4-bu2-shared" - } - } -} diff --git a/4-projects/business_unit_2/shared/common.auto.tfvars b/4-projects/business_unit_2/shared/common.auto.tfvars deleted file mode 120000 index 39aaa4621..000000000 --- a/4-projects/business_unit_2/shared/common.auto.tfvars +++ /dev/null @@ -1 +0,0 @@ -../../common.auto.tfvars \ No newline at end of file diff --git a/4-projects/business_unit_2/shared/example_infra_pipeline.tf b/4-projects/business_unit_2/shared/example_infra_pipeline.tf deleted file mode 100644 index 6bc339edd..000000000 --- a/4-projects/business_unit_2/shared/example_infra_pipeline.tf +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -locals { - repo_names = ["bu2-example-app"] -} - -module "app_infra_cloudbuild_project" { - source = "../../modules/single_project" - count = local.enable_cloudbuild_deploy ? 1 : 0 - - org_id = local.org_id - billing_account = local.billing_account - folder_id = local.common_folder_name - environment = "common" - project_budget = var.project_budget - project_prefix = local.project_prefix - activate_apis = [ - "cloudbuild.googleapis.com", - "sourcerepo.googleapis.com", - "cloudkms.googleapis.com", - "iam.googleapis.com", - "artifactregistry.googleapis.com", - "cloudresourcemanager.googleapis.com" - ] - # Metadata - project_suffix = "infra-pipeline" - application_name = "app-infra-pipelines" - billing_code = "1234" - primary_contact = "example@example.com" - secondary_contact = "example2@example.com" - business_code = "bu2" -} - -module "infra_pipelines" { - source = "../../modules/infra_pipelines" - count = local.enable_cloudbuild_deploy ? 1 : 0 - - org_id = local.org_id - cloudbuild_project_id = module.app_infra_cloudbuild_project[0].project_id - cloud_builder_artifact_repo = local.cloud_builder_artifact_repo - remote_tfstate_bucket = local.projects_remote_bucket_tfstate - billing_account = local.billing_account - default_region = var.default_region - app_infra_repos = local.repo_names - private_worker_pool_id = local.cloud_build_private_worker_pool_id -} - -/** - * When Jenkins CICD is used for deployment this resource - * is created to terraform validation works. - * Without this resource, this module creates zero resources - * and it breaks terraform validation throwing the error below: - * ERROR: [Terraform plan json does not contain resource_changes key] - */ -resource "null_resource" "jenkins_cicd" { - count = !local.enable_cloudbuild_deploy ? 1 : 0 -} diff --git a/4-projects/business_unit_2/shared/outputs.tf b/4-projects/business_unit_2/shared/outputs.tf deleted file mode 100644 index 5c3a84874..000000000 --- a/4-projects/business_unit_2/shared/outputs.tf +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -output "default_region" { - description = "Default region to create resources where applicable." - value = try(module.infra_pipelines[0].default_region, "") -} - -output "cloudbuild_project_id" { - value = try(module.app_infra_cloudbuild_project[0].project_id, "") -} - -output "terraform_service_accounts" { - description = "APP Infra Pipeline Terraform Accounts." - value = try(module.infra_pipelines[0].terraform_service_accounts, {}) -} - -output "repos" { - description = "CSRs to store source code" - value = try(module.infra_pipelines[0].repos, toset([])) -} - -output "artifact_buckets" { - description = "GCS Buckets to store Cloud Build Artifacts" - value = try(module.infra_pipelines[0].artifact_buckets, {}) -} - -output "state_buckets" { - description = "GCS Buckets to store TF state" - value = try(module.infra_pipelines[0].state_buckets, {}) -} - -output "log_buckets" { - description = "GCS Buckets to store Cloud Build logs" - value = try(module.infra_pipelines[0].log_buckets, {}) -} - -output "plan_triggers_id" { - description = "CB plan triggers" - value = try(module.infra_pipelines[0].plan_triggers_id, []) -} - -output "apply_triggers_id" { - description = "CB apply triggers" - value = try(module.infra_pipelines[0].apply_triggers_id, []) -} - -output "enable_cloudbuild_deploy" { - description = "Enable infra deployment using Cloud Build." - value = local.enable_cloudbuild_deploy -} diff --git a/4-projects/business_unit_2/shared/remote.tf b/4-projects/business_unit_2/shared/remote.tf deleted file mode 100644 index 2597f19ba..000000000 --- a/4-projects/business_unit_2/shared/remote.tf +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -locals { - org_id = data.terraform_remote_state.bootstrap.outputs.common_config.org_id - parent_folder = data.terraform_remote_state.bootstrap.outputs.common_config.parent_folder - parent = data.terraform_remote_state.bootstrap.outputs.common_config.parent_id - billing_account = data.terraform_remote_state.bootstrap.outputs.common_config.billing_account - common_folder_name = data.terraform_remote_state.org.outputs.common_folder_name - default_region = data.terraform_remote_state.bootstrap.outputs.common_config.default_region - project_prefix = data.terraform_remote_state.bootstrap.outputs.common_config.project_prefix - folder_prefix = data.terraform_remote_state.bootstrap.outputs.common_config.folder_prefix - projects_remote_bucket_tfstate = data.terraform_remote_state.bootstrap.outputs.projects_gcs_bucket_tfstate - cloud_build_private_worker_pool_id = try(data.terraform_remote_state.bootstrap.outputs.cloud_build_private_worker_pool_id, "") - cloud_builder_artifact_repo = try(data.terraform_remote_state.bootstrap.outputs.cloud_builder_artifact_repo, "") - enable_cloudbuild_deploy = local.cloud_builder_artifact_repo != "" -} - -data "terraform_remote_state" "bootstrap" { - backend = "gcs" - - config = { - bucket = var.remote_state_bucket - prefix = "terraform/bootstrap/state" - } -} - -data "terraform_remote_state" "org" { - backend = "gcs" - - config = { - bucket = var.remote_state_bucket - prefix = "terraform/org/state" - } -} diff --git a/4-projects/business_unit_2/shared/remote.tf.cloud.example b/4-projects/business_unit_2/shared/remote.tf.cloud.example deleted file mode 100644 index 525ba30af..000000000 --- a/4-projects/business_unit_2/shared/remote.tf.cloud.example +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -locals { - org_id = data.tfe_outputs.bootstrap.nonsensitive_values.common_config.org_id - parent_folder = data.tfe_outputs.bootstrap.nonsensitive_values.common_config.parent_folder - parent = data.tfe_outputs.bootstrap.nonsensitive_values.common_config.parent_id - billing_account = data.tfe_outputs.bootstrap.nonsensitive_values.common_config.billing_account - common_folder_name = data.tfe_outputs.org.nonsensitive_values.common_folder_name - default_region = data.tfe_outputs.bootstrap.nonsensitive_values.common_config.default_region - project_prefix = data.tfe_outputs.bootstrap.nonsensitive_values.common_config.project_prefix - folder_prefix = data.tfe_outputs.bootstrap.nonsensitive_values.common_config.folder_prefix - projects_remote_bucket_tfstate = "" - cloud_build_private_worker_pool_id = try(data.tfe_outputs.bootstrap.nonsensitive_values.cloud_build_private_worker_pool_id, "") - cloud_builder_artifact_repo = try(data.tfe_outputs.bootstrap.nonsensitive_values.cloud_builder_artifact_repo, "") - enable_cloudbuild_deploy = local.cloud_builder_artifact_repo != "" -} - -data "tfe_outputs" "bootstrap" { - organization = var.tfc_org_name - workspace = "0-shared" -} - -data "tfe_outputs" "org" { - organization = var.tfc_org_name - workspace = "1-shared" -} diff --git a/4-projects/business_unit_2/shared/shared.auto.tfvars b/4-projects/business_unit_2/shared/shared.auto.tfvars deleted file mode 120000 index b7f8387a8..000000000 --- a/4-projects/business_unit_2/shared/shared.auto.tfvars +++ /dev/null @@ -1 +0,0 @@ -../../shared.auto.tfvars \ No newline at end of file diff --git a/4-projects/business_unit_2/shared/variables.tf b/4-projects/business_unit_2/shared/variables.tf deleted file mode 100644 index 5f08bcddf..000000000 --- a/4-projects/business_unit_2/shared/variables.tf +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -variable "default_region" { - description = "Default region to create resources where applicable." - type = string - default = "us-central1" -} - -variable "project_budget" { - description = <