Skip to content

Commit

Permalink
chore: update examples to use registry
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathkkb committed Dec 18, 2023
1 parent b9d9eb2 commit 78516f8
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 30 deletions.
3 changes: 3 additions & 0 deletions build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
12 changes: 9 additions & 3 deletions examples/compute_instance/disk_snapshot/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ data "google_compute_zones" "available" {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

region = var.region
project_id = var.project_id
subnetwork = var.subnetwork
Expand Down Expand Up @@ -56,7 +58,9 @@ module "instance_template" {
}

module "compute_instance" {
source = "../../../modules/compute_instance"
source = "terraform-google-modules/vm/google//modules/compute_instance"
version = "~> 10.0"

region = var.region
subnetwork = var.subnetwork
num_instances = 1
Expand All @@ -65,7 +69,9 @@ module "compute_instance" {
}

module "disk_snapshots" {
source = "../../../modules/compute_disk_snapshot"
source = "terraform-google-modules/vm/google//modules/compute_disk_snapshot"
version = "~> 10.0"

name = "backup-policy-test"
project = var.project_id
region = var.region
Expand Down
8 changes: 6 additions & 2 deletions examples/compute_instance/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@
*/

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

region = var.region
project_id = var.project_id
subnetwork = var.subnetwork
service_account = var.service_account
}

module "compute_instance" {
source = "../../../modules/compute_instance"
source = "terraform-google-modules/vm/google//modules/compute_instance"
version = "~> 10.0"

region = var.region
zone = var.zone
subnetwork = var.subnetwork
Expand Down
4 changes: 3 additions & 1 deletion examples/instance_template/additional_disks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ provider "google" {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

project_id = var.project_id
subnetwork = var.subnetwork
service_account = var.service_account
Expand Down
4 changes: 3 additions & 1 deletion examples/instance_template/alias_ip_range/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ resource "google_compute_address" "ip_address" {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

project_id = var.project_id
subnetwork = var.subnetwork
service_account = var.service_account
Expand Down
4 changes: 3 additions & 1 deletion examples/instance_template/encrypted_disks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ resource "google_kms_crypto_key" "example-key" {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

project_id = var.project_id
subnetwork = var.subnetwork
service_account = var.service_account
Expand Down
4 changes: 3 additions & 1 deletion examples/instance_template/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ locals {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

project_id = var.project_id
subnetwork = var.subnetwork
stack_type = "IPV4_ONLY"
Expand Down
8 changes: 6 additions & 2 deletions examples/mig/autoscaler/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ provider "google-beta" {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

project_id = var.project_id
subnetwork = var.subnetwork
service_account = var.service_account
}

module "mig" {
source = "../../../modules/mig"
source = "terraform-google-modules/vm/google//modules/mig"
version = "~> 10.0"

project_id = var.project_id
region = var.region
hostname = "mig-autoscaler"
Expand Down
8 changes: 6 additions & 2 deletions examples/mig/full/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ provider "google-beta" {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

name_prefix = "${var.hostname}-instance-template"
project_id = var.project_id
machine_type = var.machine_type
Expand Down Expand Up @@ -55,7 +57,9 @@ module "instance_template" {
}

module "mig" {
source = "../../../modules/mig"
source = "terraform-google-modules/vm/google//modules/mig"
version = "~> 10.0"

project_id = var.project_id
hostname = var.hostname
region = var.region
Expand Down
8 changes: 6 additions & 2 deletions examples/mig/healthcheck/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ resource "google_compute_subnetwork" "main" {
/** Instance Template **/

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

project_id = var.project_id
subnetwork = google_compute_subnetwork.main.name
service_account = var.service_account
Expand All @@ -60,7 +62,9 @@ module "instance_template" {
/** Instance Group within autoscale and health check **/

module "mig" {
source = "../../../modules/mig"
source = "terraform-google-modules/vm/google//modules/mig"
version = "~> 10.0"

project_id = var.project_id
instance_template = module.instance_template.self_link
region = var.region
Expand Down
8 changes: 6 additions & 2 deletions examples/mig/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ provider "google-beta" {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

project_id = var.project_id
subnetwork = var.subnetwork
service_account = var.service_account
subnetwork_project = var.project_id
}

module "mig" {
source = "../../../modules/mig"
source = "terraform-google-modules/vm/google//modules/mig"
version = "~> 10.0"

project_id = var.project_id
region = var.region
target_size = var.target_size
Expand Down
8 changes: 6 additions & 2 deletions examples/mig_stateful/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ resource "google_compute_subnetwork" "main" {
}

module "instance_template" {
source = "../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

project_id = var.project_id
region = var.region
subnetwork = var.subnetwork
Expand All @@ -52,7 +54,9 @@ module "instance_template" {
}

module "mig" {
source = "../../modules/mig"
source = "terraform-google-modules/vm/google//modules/mig"
version = "~> 10.0"

project_id = var.project_id
region = var.region
target_size = var.target_size
Expand Down
8 changes: 6 additions & 2 deletions examples/mig_with_percent/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ provider "google-beta" {
}

module "preemptible_and_regular_instance_templates" {
source = "../../../modules/preemptible_and_regular_instance_templates"
source = "terraform-google-modules/vm/google//modules/preemptible_and_regular_instance_templates"
version = "~> 10.0"

subnetwork = var.subnetwork
service_account = var.service_account
}

module "mig_with_percent" {
source = "../../../modules/mig_with_percent"
source = "terraform-google-modules/vm/google//modules/mig_with_percent"
version = "~> 10.0"

region = var.region
target_size = 4
hostname = "mig-with-percent-simple"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ provider "google" {
}

module "preemptible_and_regular_instance_templates" {
source = "../../../modules/preemptible_and_regular_instance_templates"
source = "terraform-google-modules/vm/google//modules/preemptible_and_regular_instance_templates"
version = "~> 10.0"

subnetwork = var.subnetwork
project_id = var.project_id
service_account = var.service_account
Expand Down
8 changes: 6 additions & 2 deletions examples/umig/full/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ locals {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

name_prefix = "${var.hostname}-instance-template"
machine_type = var.machine_type
project_id = var.project_id
Expand All @@ -59,7 +61,9 @@ module "instance_template" {
}

module "umig" {
source = "../../../modules/umig"
source = "terraform-google-modules/vm/google//modules/umig"
version = "~> 10.0"

project_id = var.project_id
subnetwork = var.subnetwork
hostname = var.hostname
Expand Down
8 changes: 6 additions & 2 deletions examples/umig/named_ports/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ provider "google" {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

subnetwork = var.subnetwork
service_account = var.service_account
}

module "umig" {
source = "../../../modules/umig"
source = "terraform-google-modules/vm/google//modules/umig"
version = "~> 10.0"

project_id = var.project_id
subnetwork = var.subnetwork
num_instances = var.num_instances
Expand Down
8 changes: 6 additions & 2 deletions examples/umig/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ provider "google" {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

subnetwork = var.subnetwork
service_account = var.service_account
}

module "umig" {
source = "../../../modules/umig"
source = "terraform-google-modules/vm/google//modules/umig"
version = "~> 10.0"

project_id = var.project_id
subnetwork = var.subnetwork
num_instances = var.num_instances
Expand Down
8 changes: 6 additions & 2 deletions examples/umig/static_ips/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ provider "google" {
}

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 10.0"

subnetwork = var.subnetwork
service_account = var.service_account
}

module "umig" {
source = "../../../modules/umig"
source = "terraform-google-modules/vm/google//modules/umig"
version = "~> 10.0"

project_id = var.project_id
subnetwork = var.subnetwork
num_instances = var.num_instances
Expand Down

0 comments on commit 78516f8

Please sign in to comment.