Skip to content

Commit

Permalink
chore: update examples to use registry (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathkkb authored Dec 20, 2023
1 parent 7f85ec7 commit 2c244d1
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 27 deletions.
9 changes: 6 additions & 3 deletions examples/bidirectional-firewall-rules/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/delete_default_gateway_routes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions examples/global-network-firewall-policy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
15 changes: 11 additions & 4 deletions examples/ilb_routing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions examples/multi_vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion examples/private_service_connect/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions examples/regional-network-firewall-policy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion examples/secondary_ranges/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion examples/simple_ipv6_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/simple_project_with_regional_network/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions examples/submodule_firewall/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
18 changes: 13 additions & 5 deletions examples/submodule_network_peering/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,44 @@
*/

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
export_local_custom_routes = true
}

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
Expand Down
8 changes: 6 additions & 2 deletions examples/submodule_svpc_access/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]
Expand Down

0 comments on commit 2c244d1

Please sign in to comment.