Skip to content

Commit

Permalink
chore: update examples to use registry (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathkkb authored Dec 19, 2023
1 parent ab155cf commit 72da4d9
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 17 deletions.
3 changes: 3 additions & 0 deletions build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
8 changes: 6 additions & 2 deletions examples/app_engine/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
}
7 changes: 5 additions & 2 deletions examples/budget_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion examples/essential_contacts/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/fabric_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/gke_shared_vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/group_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions examples/project-hierarchy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/project_services/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/quota_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions examples/shared_vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/simple_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 72da4d9

Please sign in to comment.