diff --git a/build/int.cloudbuild.yaml b/build/int.cloudbuild.yaml index 25d22d11..8483119d 100644 --- a/build/int.cloudbuild.yaml +++ b/build/int.cloudbuild.yaml @@ -13,6 +13,9 @@ # limitations under the License. timeout: 3600s steps: +- id: swap-module-refs + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['module-swapper'] - id: prepare name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' args: ['/bin/bash', '-c', 'mkdir -p ~/.terraform.d && ln -s /root/.terraform.d/plugins ~/.terraform.d/plugins && source /usr/local/bin/task_helper_functions.sh && prepare_environment'] diff --git a/examples/app_engine/main.tf b/examples/app_engine/main.tf index 52d2349a..0d5f84c6 100644 --- a/examples/app_engine/main.tf +++ b/examples/app_engine/main.tf @@ -21,7 +21,9 @@ resource "random_string" "suffix" { } module "app-engine-project" { - source = "../../" + source = "terraform-google-modules/project-factory/google" + version = "~> 14.0" + name = "appeng-${random_string.suffix.result}" random_project_id = true org_id = var.org_id @@ -33,7 +35,9 @@ module "app-engine-project" { } module "app-engine" { - source = "../../modules/app_engine" + source = "terraform-google-modules/project-factory/google//modules/app_engine" + version = "~> 14.0" + project_id = module.app-engine-project.project_id location_id = "us-east4" } diff --git a/examples/budget_project/main.tf b/examples/budget_project/main.tf index b0552dfb..1549ac8a 100644 --- a/examples/budget_project/main.tf +++ b/examples/budget_project/main.tf @@ -21,7 +21,9 @@ resource "random_string" "suffix" { } module "budget_project" { - source = "../../" + source = "terraform-google-modules/project-factory/google" + version = "~> 14.0" + name = "budget-project-${random_string.suffix.result}" random_project_id = true random_project_id_length = 6 @@ -46,7 +48,8 @@ resource "google_pubsub_topic" "budget" { } module "additional_budget" { - source = "../../modules/budget" + source = "terraform-google-modules/project-factory/google//modules/budget" + version = "~> 14.0" billing_account = var.billing_account projects = [var.parent_project_id, module.budget_project.project_id] diff --git a/examples/essential_contacts/main.tf b/examples/essential_contacts/main.tf index 5a5f7fa4..28860e42 100644 --- a/examples/essential_contacts/main.tf +++ b/examples/essential_contacts/main.tf @@ -15,7 +15,8 @@ */ module "project-factory" { - source = "../../" + source = "terraform-google-modules/project-factory/google" + version = "~> 14.0" name = "pf-ci-test-ec-${var.random_string_for_testing}" random_project_id = true diff --git a/examples/fabric_project/main.tf b/examples/fabric_project/main.tf index 611f2a4c..973b09da 100644 --- a/examples/fabric_project/main.tf +++ b/examples/fabric_project/main.tf @@ -26,7 +26,9 @@ resource "random_string" "prefix" { } module "fabric-project" { - source = "../../modules/fabric-project" + source = "terraform-google-modules/project-factory/google//modules/fabric-project" + version = "~> 14.0" + activate_apis = var.activate_apis billing_account = var.billing_account name = var.name diff --git a/examples/gke_shared_vpc/main.tf b/examples/gke_shared_vpc/main.tf index 11862701..62789897 100644 --- a/examples/gke_shared_vpc/main.tf +++ b/examples/gke_shared_vpc/main.tf @@ -15,7 +15,9 @@ */ module "project-factory" { - source = "../../" + source = "terraform-google-modules/project-factory/google" + version = "~> 14.0" + random_project_id = true name = "sample-gke-shared-project" org_id = var.org_id diff --git a/examples/group_project/main.tf b/examples/group_project/main.tf index da2b0d17..76c8e2ac 100644 --- a/examples/group_project/main.tf +++ b/examples/group_project/main.tf @@ -28,7 +28,9 @@ provider "gsuite" { } module "project-factory" { - source = "../../modules/gsuite_enabled" + source = "terraform-google-modules/project-factory/google//modules/gsuite_enabled" + version = "~> 14.0" + random_project_id = true name = "group-sample-project" org_id = var.organization_id diff --git a/examples/project-hierarchy/main.tf b/examples/project-hierarchy/main.tf index 439a2161..93e53a2b 100644 --- a/examples/project-hierarchy/main.tf +++ b/examples/project-hierarchy/main.tf @@ -32,7 +32,9 @@ resource "google_folder" "prod" { } module "project-prod-gke" { - source = "../../modules/gsuite_enabled" + source = "terraform-google-modules/project-factory/google//modules/gsuite_enabled" + version = "~> 14.0" + random_project_id = true name = "hierarchy-sample-prod-gke" org_id = var.organization_id @@ -41,7 +43,9 @@ module "project-prod-gke" { } module "project-factory" { - source = "../../modules/gsuite_enabled" + source = "terraform-google-modules/project-factory/google//modules/gsuite_enabled" + version = "~> 14.0" + random_project_id = true name = "hierarchy-sample-factory" org_id = var.organization_id diff --git a/examples/project_services/main.tf b/examples/project_services/main.tf index c9331340..4002ae1b 100644 --- a/examples/project_services/main.tf +++ b/examples/project_services/main.tf @@ -18,7 +18,9 @@ Provider configuration *****************************************/ module "project-services" { - source = "../../modules/project_services" + source = "terraform-google-modules/project-factory/google//modules/project_services" + version = "~> 14.0" + project_id = var.project_id enable_apis = var.enable disable_services_on_destroy = true diff --git a/examples/quota_project/main.tf b/examples/quota_project/main.tf index 896dc390..4a97794e 100644 --- a/examples/quota_project/main.tf +++ b/examples/quota_project/main.tf @@ -25,7 +25,9 @@ resource "random_string" "suffix" { } module "quota-project" { - source = "../../" + source = "terraform-google-modules/project-factory/google" + version = "~> 14.0" + name = "pf-ci-test-quota-${random_string.suffix.result}" random_project_id = true org_id = var.org_id diff --git a/examples/shared_vpc/main.tf b/examples/shared_vpc/main.tf index 3358073b..35fed6f8 100644 --- a/examples/shared_vpc/main.tf +++ b/examples/shared_vpc/main.tf @@ -23,7 +23,9 @@ locals { Host Project Creation *****************************************/ module "host-project" { - source = "../../" + source = "terraform-google-modules/project-factory/google" + version = "~> 14.0" + random_project_id = true name = var.host_project_name org_id = var.organization_id @@ -90,7 +92,8 @@ module "vpc" { Service Project Creation *****************************************/ module "service-project" { - source = "../../modules/svpc_service_project" + source = "terraform-google-modules/project-factory/google//modules/svpc_service_project" + version = "~> 14.0" name = var.service_project_name random_project_id = false @@ -116,7 +119,8 @@ module "service-project" { Second Service Project Creation *****************************************/ module "service-project-b" { - source = "../../modules/svpc_service_project" + source = "terraform-google-modules/project-factory/google//modules/svpc_service_project" + version = "~> 14.0" name = "b-${var.service_project_name}" random_project_id = false @@ -149,7 +153,8 @@ module "service-project-b" { To test the grant_network_role *****************************************/ module "service-project-c" { - source = "../../modules/svpc_service_project" + source = "terraform-google-modules/project-factory/google//modules/svpc_service_project" + version = "~> 14.0" name = "c-${var.service_project_name}" random_project_id = false diff --git a/examples/simple_project/main.tf b/examples/simple_project/main.tf index 1efa741e..dd14cc46 100644 --- a/examples/simple_project/main.tf +++ b/examples/simple_project/main.tf @@ -15,7 +15,9 @@ */ module "project-factory" { - source = "../../" + source = "terraform-google-modules/project-factory/google" + version = "~> 14.0" + random_project_id = true name = "simple-sample-project" org_id = var.organization_id