From 2c244d159444fbc169c940e13b529ba3de9f44eb Mon Sep 17 00:00:00 2001 From: Bharath KKB Date: Tue, 19 Dec 2023 22:50:42 -0600 Subject: [PATCH] chore: update examples to use registry (#533) --- examples/bidirectional-firewall-rules/main.tf | 9 ++++++--- examples/delete_default_gateway_routes/main.tf | 4 +++- .../global-network-firewall-policy/main.tf | 7 +++++-- examples/ilb_routing/main.tf | 15 +++++++++++---- examples/multi_vpc/main.tf | 7 +++++-- examples/private_service_connect/main.tf | 4 +++- .../regional-network-firewall-policy/main.tf | 7 +++++-- examples/secondary_ranges/main.tf | 4 +++- examples/simple_ipv6_project/main.tf | 4 +++- .../main.tf | 4 +++- examples/submodule_firewall/main.tf | 7 +++++-- examples/submodule_network_peering/main.tf | 18 +++++++++++++----- examples/submodule_svpc_access/main.tf | 8 ++++++-- 13 files changed, 71 insertions(+), 27 deletions(-) diff --git a/examples/bidirectional-firewall-rules/main.tf b/examples/bidirectional-firewall-rules/main.tf index 89ea5869..dc8ffa72 100644 --- a/examples/bidirectional-firewall-rules/main.tf +++ b/examples/bidirectional-firewall-rules/main.tf @@ -176,7 +176,8 @@ locals { } module "test-vpc-module" { - source = "../../" + source = "terraform-google-modules/network/google" + version = "~> 8.0" project_id = var.project_id network_name = var.network_name @@ -198,14 +199,16 @@ module "test-vpc-module" { module "test-firewall-submodule" { - source = "../../modules/firewall-rules" + source = "terraform-google-modules/network/google//modules/firewall-rules" + version = "~> 8.0" project_id = var.project_id network_name = module.test-vpc-module.network_name rules = local.custom_rules } module "test-firewall-submodule-ing-egr" { - source = "../../modules/firewall-rules" + source = "terraform-google-modules/network/google//modules/firewall-rules" + version = "~> 8.0" project_id = var.project_id network_name = module.test-vpc-module.network_name ingress_rules = local.custom_rules_ingress diff --git a/examples/delete_default_gateway_routes/main.tf b/examples/delete_default_gateway_routes/main.tf index 67265762..0d5ff6d0 100644 --- a/examples/delete_default_gateway_routes/main.tf +++ b/examples/delete_default_gateway_routes/main.tf @@ -19,7 +19,9 @@ locals { } module "test-vpc-module" { - source = "../../" + source = "terraform-google-modules/network/google" + version = "~> 8.0" + project_id = var.project_id network_name = var.network_name delete_default_internet_gateway_routes = true diff --git a/examples/global-network-firewall-policy/main.tf b/examples/global-network-firewall-policy/main.tf index 59c9315b..bc671171 100644 --- a/examples/global-network-firewall-policy/main.tf +++ b/examples/global-network-firewall-policy/main.tf @@ -75,7 +75,9 @@ resource "google_service_account" "service_account" { } module "firewal_policy" { - source = "../../modules/network-firewall-policy" + source = "terraform-google-modules/network/google//modules/network-firewall-policy" + version = "~> 8.0" + project_id = var.project_id policy_name = "${local.prefix}-firewall-policy-${random_string.random_suffix.result}" description = "test ${local.prefix} firewall policy" @@ -213,7 +215,8 @@ module "firewal_policy" { } module "firewal_policy_no_rule" { - source = "../../modules/network-firewall-policy" + source = "terraform-google-modules/network/google//modules/network-firewall-policy" + version = "~> 8.0" project_id = var.project_id policy_name = "${local.prefix}-firewall-policy-no-rules-${random_string.random_suffix.result}" description = "${local.prefix} test firewall policy without any rules" diff --git a/examples/ilb_routing/main.tf b/examples/ilb_routing/main.tf index 8cb2b8bb..94ec52ef 100644 --- a/examples/ilb_routing/main.tf +++ b/examples/ilb_routing/main.tf @@ -15,13 +15,17 @@ */ module "vpc" { - source = "../../modules/vpc" + source = "terraform-google-modules/network/google//modules/vpc" + version = "~> 8.0" + network_name = var.network_name project_id = var.project_id } module "subnets" { - source = "../../modules/subnets-beta" + source = "terraform-google-modules/network/google//modules/subnets-beta" + version = "~> 8.0" + project_id = var.project_id network_name = module.vpc.network_name @@ -42,7 +46,9 @@ module "subnets" { } module "subnets-backup" { - source = "../../modules/subnets-beta" + source = "terraform-google-modules/network/google//modules/subnets-beta" + version = "~> 8.0" + project_id = var.project_id network_name = module.vpc.network_name @@ -90,7 +96,8 @@ resource "google_compute_forwarding_rule" "this" { } module "routes" { - source = "../../modules/routes-beta" + source = "terraform-google-modules/network/google//modules/routes-beta" + version = "~> 8.0" project_id = var.project_id network_name = module.vpc.network_name routes_count = 2 diff --git a/examples/multi_vpc/main.tf b/examples/multi_vpc/main.tf index 4e4f536a..ae04f07c 100644 --- a/examples/multi_vpc/main.tf +++ b/examples/multi_vpc/main.tf @@ -50,7 +50,9 @@ locals { } module "test-vpc-module-01" { - source = "../../" + source = "terraform-google-modules/network/google" + version = "~> 8.0" + project_id = var.project_id network_name = var.network_01_name @@ -102,7 +104,8 @@ module "test-vpc-module-01" { } module "test-vpc-module-02" { - source = "../../" + source = "terraform-google-modules/network/google" + version = "~> 8.0" project_id = var.project_id network_name = var.network_02_name diff --git a/examples/private_service_connect/main.tf b/examples/private_service_connect/main.tf index b14cd82d..9adcc8dd 100644 --- a/examples/private_service_connect/main.tf +++ b/examples/private_service_connect/main.tf @@ -21,7 +21,9 @@ # example may fail until that is done. module "private_service_connect" { - source = "../../modules/private-service-connect" + source = "terraform-google-modules/network/google//modules/private-service-connect" + version = "~> 8.0" + project_id = var.project_id network_self_link = module.simple_vpc.network_self_link private_service_connect_ip = "10.3.0.5" diff --git a/examples/regional-network-firewall-policy/main.tf b/examples/regional-network-firewall-policy/main.tf index 730e12f5..ed171569 100644 --- a/examples/regional-network-firewall-policy/main.tf +++ b/examples/regional-network-firewall-policy/main.tf @@ -78,7 +78,9 @@ resource "google_service_account" "service_account" { } module "firewal_policy" { - source = "../../modules/network-firewall-policy" + source = "terraform-google-modules/network/google//modules/network-firewall-policy" + version = "~> 8.0" + project_id = var.project_id policy_name = "${local.prefix}-firewall-policy-${random_string.random_suffix.result}" description = "test ${local.prefix} firewall policy" @@ -217,7 +219,8 @@ module "firewal_policy" { } module "firewal_policy_no_rule" { - source = "../../modules/network-firewall-policy" + source = "terraform-google-modules/network/google//modules/network-firewall-policy" + version = "~> 8.0" project_id = var.project_id policy_name = "${local.prefix}-firewall-policy-no-rules-${random_string.random_suffix.result}" description = "${local.prefix} test firewall policy without any rules" diff --git a/examples/secondary_ranges/main.tf b/examples/secondary_ranges/main.tf index 4820b876..8427ce87 100644 --- a/examples/secondary_ranges/main.tf +++ b/examples/secondary_ranges/main.tf @@ -22,7 +22,9 @@ locals { } module "vpc-secondary-ranges" { - source = "../../" + source = "terraform-google-modules/network/google" + version = "~> 8.0" + project_id = var.project_id network_name = var.network_name diff --git a/examples/simple_ipv6_project/main.tf b/examples/simple_ipv6_project/main.tf index 692c5f14..6885025c 100644 --- a/examples/simple_ipv6_project/main.tf +++ b/examples/simple_ipv6_project/main.tf @@ -22,7 +22,9 @@ # [START vpc_custom_create] module "test-vpc-module" { - source = "../../" + source = "terraform-google-modules/network/google" + version = "~> 8.0" + project_id = var.project_id # Replace this with your project ID in quotes network_name = "my-custom-mode-network" mtu = 1460 diff --git a/examples/simple_project_with_regional_network/main.tf b/examples/simple_project_with_regional_network/main.tf index da32cb3a..723c7e07 100644 --- a/examples/simple_project_with_regional_network/main.tf +++ b/examples/simple_project_with_regional_network/main.tf @@ -20,7 +20,9 @@ locals { } module "test-vpc-module" { - source = "../../" + source = "terraform-google-modules/network/google" + version = "~> 8.0" + project_id = var.project_id network_name = var.network_name routing_mode = "REGIONAL" diff --git a/examples/submodule_firewall/main.tf b/examples/submodule_firewall/main.tf index cc6ac6e9..d1ff2c38 100644 --- a/examples/submodule_firewall/main.tf +++ b/examples/submodule_firewall/main.tf @@ -20,7 +20,9 @@ locals { } module "test-vpc-module" { - source = "../../" + source = "terraform-google-modules/network/google" + version = "~> 8.0" + project_id = var.project_id network_name = var.network_name @@ -115,7 +117,8 @@ locals { module "test-firewall-submodule" { - source = "../../modules/fabric-net-firewall" + source = "terraform-google-modules/network/google//modules/fabric-net-firewall" + version = "~> 8.0" project_id = var.project_id network = module.test-vpc-module.network_name internal_ranges_enabled = true diff --git a/examples/submodule_network_peering/main.tf b/examples/submodule_network_peering/main.tf index e71ad1d3..b0487b7e 100644 --- a/examples/submodule_network_peering/main.tf +++ b/examples/submodule_network_peering/main.tf @@ -15,28 +15,35 @@ */ module "local-network" { - source = "../../" + source = "terraform-google-modules/network/google" + version = "~> 8.0" + project_id = var.project_id network_name = "local-network" subnets = [] } module "peer-network-1" { - source = "../../" + source = "terraform-google-modules/network/google" + version = "~> 8.0" + project_id = var.project_id network_name = "peer-network-1" subnets = [] } module "peer-network-2" { - source = "../../" + source = "terraform-google-modules/network/google" + version = "~> 8.0" + project_id = var.project_id network_name = "peer-network-2" subnets = [] } module "peering-1" { - source = "../../modules/network-peering" + source = "terraform-google-modules/network/google//modules/network-peering" + version = "~> 8.0" local_network = module.local-network.network_self_link peer_network = module.peer-network-1.network_self_link @@ -44,7 +51,8 @@ module "peering-1" { } module "peering-2" { - source = "../../modules/network-peering" + source = "terraform-google-modules/network/google//modules/network-peering" + version = "~> 8.0" local_network = module.local-network.network_self_link peer_network = module.peer-network-2.network_self_link diff --git a/examples/submodule_svpc_access/main.tf b/examples/submodule_svpc_access/main.tf index f25e849c..cf64cd9d 100644 --- a/examples/submodule_svpc_access/main.tf +++ b/examples/submodule_svpc_access/main.tf @@ -22,7 +22,9 @@ locals { } module "net-vpc-shared" { - source = "../.." + source = "terraform-google-modules/network/google" + version = "~> 8.0" + project_id = var.host_project_id network_name = var.network_name shared_vpc_host = true @@ -42,7 +44,9 @@ module "net-vpc-shared" { } module "net-svpc-access" { - source = "../../modules/fabric-net-svpc-access" + source = "terraform-google-modules/network/google//modules/fabric-net-svpc-access" + version = "~> 8.0" + host_project_id = module.net-vpc-shared.project_id service_project_ids = [var.service_project_id] host_subnets = ["data"]