diff --git a/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/__init__.py b/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/__init__.py index d46dbae5..6d6d1266 100644 --- a/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/__init__.py +++ b/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/fixture/main.tf b/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/fixture/main.tf index 8d8afe2d..08a7035d 100644 --- a/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/fixture/main.tf +++ b/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/fixture/main.tf @@ -1,5 +1,5 @@ /** - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,8 @@ */ module "test" { - source = "../../../../data-solutions/gcs-to-bq-with-least-privileges/" - billing_account = var.billing_account - root_node = var.root_node - project_name = var.project_name + source = "../../../../../examples/data-solutions/gcs-to-bq-with-least-privileges/" + project_create = var.project_create + project_id = var.project_id + prefix = var.prefix } diff --git a/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/fixture/variables.tf b/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/fixture/variables.tf index e277a6c1..03fa1395 100644 --- a/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/fixture/variables.tf +++ b/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/fixture/variables.tf @@ -1,5 +1,5 @@ /** - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,26 @@ * limitations under the License. */ -variable "billing_account" { - type = string - default = "123456-123456-123456" +variable "prefix" { + description = "Unique prefix used for resource names. Not used for project if 'project_create' is null." + type = string + default = "prefix" } -variable "project_name" { - description = "The project name." - type = string - default = "gcs2bq-least-privileges" +variable "project_create" { + description = "Provide values if project creation is needed, uses existing project if null. Parent is in 'folders/nnn' or 'organizations/nnn' format" + type = object({ + billing_account_id = string + parent = string + }) + default = { + billing_account_id = "123456-123456-123456" + parent = "folders/12345678" + } } -variable "root_node" { - description = "The resource name of the parent Folder or Organization. Must be of the form folders/folder_id or organizations/org_id." +variable "project_id" { + description = "Project id, references existing project if `project_create` is null." type = string - default = "folders/12345678" + default = "datalake" } diff --git a/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/test_plan.py b/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/test_plan.py index f8e4ffeb..dffa25d2 100644 --- a/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/test_plan.py +++ b/tests/examples/data_solutions/gcs_to_bq_with_least_privileges/test_plan.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,4 +24,4 @@ def test_resources(e2e_plan_runner): "Test that plan works and the numbers of resources is as expected." modules, resources = e2e_plan_runner(FIXTURES_DIR) assert len(modules) == 11 - assert len(resources) == 49 + assert len(resources) == 43