From 964ce8ea9bf64ca9f7ddc233a66c6740722417ea Mon Sep 17 00:00:00 2001 From: Bharath KKB Date: Tue, 19 Dec 2023 10:45:16 -0600 Subject: [PATCH] chore: update examples to use registry (#212) --- build/int.cloudbuild.yaml | 3 +++ examples/bigquery_dataset/main.tf | 4 +++- examples/billing_account/main.tf | 3 ++- examples/cloud_run_service/main.tf | 4 +++- examples/custom_role_org/main.tf | 3 ++- examples/custom_role_project/main.tf | 3 ++- examples/dns_zone/main.tf | 4 +++- examples/folder/main.tf | 4 +++- examples/kms_crypto_key/main.tf | 4 +++- examples/kms_key_ring/main.tf | 4 +++- examples/member_iam/main.tf | 4 +++- examples/organization/main.tf | 4 +++- examples/project/main.tf | 4 +++- examples/project_conditions/main.tf | 4 +++- examples/pubsub_subscription/main.tf | 4 +++- examples/pubsub_topic/main.tf | 4 +++- examples/secret_manager/main.tf | 4 +++- examples/service_account/main.tf | 3 ++- examples/storage_bucket/main.tf | 4 +++- examples/subnet/main.tf | 3 ++- examples/tag_keys/main.tf | 4 +++- examples/tag_values/main.tf | 4 +++- 22 files changed, 61 insertions(+), 21 deletions(-) diff --git a/build/int.cloudbuild.yaml b/build/int.cloudbuild.yaml index 473fec0b..915d6497 100644 --- a/build/int.cloudbuild.yaml +++ b/build/int.cloudbuild.yaml @@ -14,6 +14,9 @@ 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', 'source /usr/local/bin/task_helper_functions.sh && prepare_environment'] diff --git a/examples/bigquery_dataset/main.tf b/examples/bigquery_dataset/main.tf index 9eb9e3c0..49bc9ac6 100644 --- a/examples/bigquery_dataset/main.tf +++ b/examples/bigquery_dataset/main.tf @@ -18,7 +18,9 @@ Module bigquery_dataset_iam_binding calling *********************************************/ module "bigquery_dataset_iam_binding" { - source = "../../modules/bigquery_datasets_iam/" + source = "terraform-google-modules/iam/google//modules/bigquery_datasets_iam" + version = "~> 7.0" + project = var.project_id bigquery_datasets = [ google_bigquery_dataset.bigquery_dataset_one.dataset_id, diff --git a/examples/billing_account/main.tf b/examples/billing_account/main.tf index 1a995d1f..08ae31ef 100644 --- a/examples/billing_account/main.tf +++ b/examples/billing_account/main.tf @@ -34,7 +34,8 @@ locals { Module billing_account_iam_binding calling *****************************************/ module "billing-account-iam" { - source = "../../modules/billing_accounts_iam/" + source = "terraform-google-modules/iam/google//modules/billing_accounts_iam" + version = "~> 7.0" billing_account_ids = [var.billing_account_id] diff --git a/examples/cloud_run_service/main.tf b/examples/cloud_run_service/main.tf index 22a436fe..564c9b9c 100644 --- a/examples/cloud_run_service/main.tf +++ b/examples/cloud_run_service/main.tf @@ -19,7 +19,9 @@ *****************************************/ module "cloud_run_service_iam_binding" { - source = "../../modules/cloud_run_services_iam/" + source = "terraform-google-modules/iam/google//modules/cloud_run_services_iam" + version = "~> 7.0" + project = var.cloud_run_service_project location = var.cloud_run_service_location cloud_run_services = [var.cloud_run_service_one, var.cloud_run_service_two] diff --git a/examples/custom_role_org/main.tf b/examples/custom_role_org/main.tf index 0a2418e4..ccbc6e7f 100644 --- a/examples/custom_role_org/main.tf +++ b/examples/custom_role_org/main.tf @@ -22,7 +22,8 @@ resource "random_id" "rand_custom_id" { Module custom_role call *****************************************/ module "custom-roles-org" { - source = "../../modules/custom_role_iam/" + source = "terraform-google-modules/iam/google//modules/custom_role_iam" + version = "~> 7.0" target_level = "org" target_id = var.org_id diff --git a/examples/custom_role_project/main.tf b/examples/custom_role_project/main.tf index 75291c86..a5a61089 100644 --- a/examples/custom_role_project/main.tf +++ b/examples/custom_role_project/main.tf @@ -18,7 +18,8 @@ Module custom_role call *****************************************/ module "custom-role-project" { - source = "../../modules/custom_role_iam/" + source = "terraform-google-modules/iam/google//modules/custom_role_iam" + version = "~> 7.0" target_level = "project" target_id = var.project_id diff --git a/examples/dns_zone/main.tf b/examples/dns_zone/main.tf index 0c22f0e0..68e04add 100644 --- a/examples/dns_zone/main.tf +++ b/examples/dns_zone/main.tf @@ -18,7 +18,9 @@ Module dns_zone_iam_binding calling *********************************************/ module "dns_zones_iam_binding" { - source = "../../modules/dns_zones_iam/" + source = "terraform-google-modules/iam/google//modules/dns_zones_iam" + version = "~> 7.0" + project = var.project_id managed_zones = [ google_dns_managed_zone.dns_zone_one.name, diff --git a/examples/folder/main.tf b/examples/folder/main.tf index e0127333..f4743d03 100644 --- a/examples/folder/main.tf +++ b/examples/folder/main.tf @@ -18,7 +18,9 @@ Module folder_iam_binding calling *****************************************/ module "folder-iam" { - source = "../../modules/folders_iam/" + source = "terraform-google-modules/iam/google//modules/folders_iam" + version = "~> 7.0" + folders = [var.folder_one, var.folder_two] mode = "additive" diff --git a/examples/kms_crypto_key/main.tf b/examples/kms_crypto_key/main.tf index 02b5bbe1..6bb2c5f6 100644 --- a/examples/kms_crypto_key/main.tf +++ b/examples/kms_crypto_key/main.tf @@ -18,7 +18,9 @@ Module kms_crypto_key_iam_binding calling *****************************************/ module "kms_crypto_key_iam_binding" { - source = "../../modules/kms_crypto_keys_iam/" + source = "terraform-google-modules/iam/google//modules/kms_crypto_keys_iam" + version = "~> 7.0" + kms_crypto_keys = [var.kms_crypto_key_one, var.kms_crypto_key_two] mode = "authoritative" diff --git a/examples/kms_key_ring/main.tf b/examples/kms_key_ring/main.tf index 8f045b2f..c8bafb09 100644 --- a/examples/kms_key_ring/main.tf +++ b/examples/kms_key_ring/main.tf @@ -18,7 +18,9 @@ Module kms_key_ring_iam_binding calling *****************************************/ module "kms_key_ring_iam_binding" { - source = "../../modules/kms_key_rings_iam/" + source = "terraform-google-modules/iam/google//modules/kms_key_rings_iam" + version = "~> 7.0" + kms_key_rings = [var.kms_key_ring_one, var.kms_key_ring_two] mode = "additive" diff --git a/examples/member_iam/main.tf b/examples/member_iam/main.tf index 8886ca08..c09aa62b 100644 --- a/examples/member_iam/main.tf +++ b/examples/member_iam/main.tf @@ -21,7 +21,9 @@ resource "google_service_account" "member_iam_test" { } module "member_roles" { - source = "../../modules/member_iam" + source = "terraform-google-modules/iam/google//modules/member_iam" + version = "~> 7.0" + service_account_address = google_service_account.member_iam_test.email project_id = var.project_id project_roles = ["roles/compute.networkAdmin", "roles/appengine.appAdmin"] diff --git a/examples/organization/main.tf b/examples/organization/main.tf index bf72727c..f70be8a3 100644 --- a/examples/organization/main.tf +++ b/examples/organization/main.tf @@ -18,7 +18,9 @@ Module organization_iam_binding calling *****************************************/ module "organization_iam_binding" { - source = "../../modules/organizations_iam/" + source = "terraform-google-modules/iam/google//modules/organizations_iam" + version = "~> 7.0" + organizations = [var.organization_one, var.organization_two] mode = "authoritative" diff --git a/examples/project/main.tf b/examples/project/main.tf index 1c1760fc..07d1ff15 100644 --- a/examples/project/main.tf +++ b/examples/project/main.tf @@ -18,7 +18,9 @@ Module project_iam_binding calling *****************************************/ module "project_iam_binding" { - source = "../../modules/projects_iam/" + source = "terraform-google-modules/iam/google//modules/projects_iam" + version = "~> 7.0" + projects = [var.project_one, var.project_two] mode = "additive" diff --git a/examples/project_conditions/main.tf b/examples/project_conditions/main.tf index 898d7fa3..e54c22bf 100644 --- a/examples/project_conditions/main.tf +++ b/examples/project_conditions/main.tf @@ -18,7 +18,9 @@ Module project_iam_binding calling *****************************************/ module "project_iam_binding" { - source = "../../modules/projects_iam/" + source = "terraform-google-modules/iam/google//modules/projects_iam" + version = "~> 7.0" + projects = [var.project_one, var.project_two] mode = "additive" diff --git a/examples/pubsub_subscription/main.tf b/examples/pubsub_subscription/main.tf index 5a274123..2898685a 100644 --- a/examples/pubsub_subscription/main.tf +++ b/examples/pubsub_subscription/main.tf @@ -18,7 +18,9 @@ Module pubsub_subscription_iam_binding calling *****************************************/ module "pubsub_subscription_iam_binding" { - source = "../../modules/pubsub_subscriptions_iam/" + source = "terraform-google-modules/iam/google//modules/pubsub_subscriptions_iam" + version = "~> 7.0" + project = var.pubsub_subscription_project pubsub_subscriptions = [var.pubsub_subscription_one, var.pubsub_subscription_two] mode = "additive" diff --git a/examples/pubsub_topic/main.tf b/examples/pubsub_topic/main.tf index 3399a23a..a50df346 100644 --- a/examples/pubsub_topic/main.tf +++ b/examples/pubsub_topic/main.tf @@ -18,7 +18,9 @@ Module pubsub_topic_iam_binding calling *****************************************/ module "pubsub_topic_iam_binding" { - source = "../../modules/pubsub_topics_iam/" + source = "terraform-google-modules/iam/google//modules/pubsub_topics_iam" + version = "~> 7.0" + project = var.pubsub_topic_project pubsub_topics = [var.pubsub_topic_one, var.pubsub_topic_two] mode = "authoritative" diff --git a/examples/secret_manager/main.tf b/examples/secret_manager/main.tf index 02361fef..363a43bc 100644 --- a/examples/secret_manager/main.tf +++ b/examples/secret_manager/main.tf @@ -18,7 +18,9 @@ Module secret_iam_binding calling *****************************************/ module "folder-iam" { - source = "../../modules/secret_manager_iam" + source = "terraform-google-modules/iam/google//modules/secret_manager_iam" + version = "~> 7.0" + project = var.project_id secrets = [var.secret_one, var.secret_two] diff --git a/examples/service_account/main.tf b/examples/service_account/main.tf index cc285d00..8a4853d7 100644 --- a/examples/service_account/main.tf +++ b/examples/service_account/main.tf @@ -18,7 +18,8 @@ Module service_account_iam_binding calling *****************************************/ module "service_account_iam_binding" { - source = "../../modules/service_accounts_iam/" + source = "terraform-google-modules/iam/google//modules/service_accounts_iam" + version = "~> 7.0" service_accounts = [var.service_account_one, var.service_account_two] project = var.service_account_project diff --git a/examples/storage_bucket/main.tf b/examples/storage_bucket/main.tf index b4837904..b3a391c4 100644 --- a/examples/storage_bucket/main.tf +++ b/examples/storage_bucket/main.tf @@ -18,7 +18,9 @@ Module pubsub_subscription_iam_binding calling *****************************************/ module "storage_buckets_iam_binding" { - source = "../../modules/storage_buckets_iam/" + source = "terraform-google-modules/iam/google//modules/storage_buckets_iam" + version = "~> 7.0" + storage_buckets = [var.storage_bucket_one, var.storage_bucket_two] mode = "additive" diff --git a/examples/subnet/main.tf b/examples/subnet/main.tf index fa6636f6..d77af88e 100644 --- a/examples/subnet/main.tf +++ b/examples/subnet/main.tf @@ -33,7 +33,8 @@ locals { Module pubsub_subscription_iam_binding calling *****************************************/ module "subnet_iam_binding" { - source = "../../modules/subnets_iam" + source = "terraform-google-modules/iam/google//modules/subnets_iam" + version = "~> 7.0" subnets = [local.subnet_one_full, local.subnet_two_full] subnets_region = var.region diff --git a/examples/tag_keys/main.tf b/examples/tag_keys/main.tf index 27bc82de..2fc89850 100644 --- a/examples/tag_keys/main.tf +++ b/examples/tag_keys/main.tf @@ -18,7 +18,9 @@ Module tag_keys_iam_binding calling *********************************************/ module "tag_keys_iam_binding" { - source = "../../modules/tag_keys_iam/" + source = "terraform-google-modules/iam/google//modules/tag_keys_iam" + version = "~> 7.0" + tag_keys = [ google_tags_tag_key.tag_key.name, ] diff --git a/examples/tag_values/main.tf b/examples/tag_values/main.tf index 637cc408..f3f7eb85 100644 --- a/examples/tag_values/main.tf +++ b/examples/tag_values/main.tf @@ -18,7 +18,9 @@ Module tag_values_iam_binding calling *********************************************/ module "tag_values_iam_binding" { - source = "../../modules/tag_values_iam/" + source = "terraform-google-modules/iam/google//modules/tag_values_iam" + version = "~> 7.0" + tag_values = [ google_tags_tag_value.tag_value.name, ]