From 8dc026a03c11f4f044fca7583c9858ce0e82ff8e Mon Sep 17 00:00:00 2001 From: Paul Xu Date: Wed, 17 Jul 2024 20:48:16 -0400 Subject: [PATCH] update tests --- README.md | 2 +- main.tf | 7 ++++--- tests/simple-project/main.tf | 1 + tests/simple_project.tftest.hcl | 6 ------ version.tf | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c851f95..5aafad2 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [project](#module\_project) | terraform-google-modules/project-factory/google | = 15.0.1 | +| [project](#module\_project) | terraform-google-modules/project-factory/google | ~> 15.0 | | [projects\_iam\_bindings](#module\_projects\_iam\_bindings) | terraform-google-modules/iam/google//modules/projects_iam | 7.7.1 | ## Resources diff --git a/main.tf b/main.tf index a776561..92ac40f 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,6 @@ module "project" { source = "terraform-google-modules/project-factory/google" - version = "= 15.0.1" + version = "~> 15.0" name = var.project_name random_project_id = true @@ -21,8 +21,9 @@ module "project" { # ----------------------------- module "projects_iam_bindings" { - source = "terraform-google-modules/iam/google//modules/projects_iam" - version = "7.7.1" + source = "terraform-google-modules/iam/google//modules/projects_iam" + version = "7.7.1" + mode = "authoritative" projects = [module.project.project_id] bindings = { diff --git a/tests/simple-project/main.tf b/tests/simple-project/main.tf index 17afe22..3588097 100644 --- a/tests/simple-project/main.tf +++ b/tests/simple-project/main.tf @@ -14,4 +14,5 @@ module "simple-project" { billing_account = var.billing_account activate_apis = var.activate_apis folder_id = var.folder_id + org_id = var.org_id } diff --git a/tests/simple_project.tftest.hcl b/tests/simple_project.tftest.hcl index 9da36da..3d1d021 100644 --- a/tests/simple_project.tftest.hcl +++ b/tests/simple_project.tftest.hcl @@ -4,12 +4,6 @@ run "simple_project_test" { source = "./tests/simple-project" } - variables { - org_id = "123456789" - folder_id = "123456789" - billing_account = "" - } - assert { condition = simple-project.id != null error_message = "Project does not exist!" diff --git a/version.tf b/version.tf index ddb8142..8515a14 100644 --- a/version.tf +++ b/version.tf @@ -3,7 +3,7 @@ terraform { required_providers { google = { - source = "hashicorp/google" + source = "hashicorp/google" version = "5.38.0" } }