diff --git a/blueprints/data-solutions/cloudsql-multiregion/README.md b/blueprints/data-solutions/cloudsql-multiregion/README.md index d6420d6c91..8b8e7e3e35 100644 --- a/blueprints/data-solutions/cloudsql-multiregion/README.md +++ b/blueprints/data-solutions/cloudsql-multiregion/README.md @@ -165,3 +165,20 @@ The above command will delete the associated resources so there will be no billa | [service_accounts](outputs.tf#L46) | Service Accounts. | | + +## Test + +```hcl +module "test" { + source = "./fabric/blueprints/data-solutions/cloudsql-multiregion/" + data_eng_principals = ["dataeng@example.com"] + postgres_user_password = "my-root-password" + project_id = "project" + project_create = { + billing_account_id = "123456-123456-123456" + parent = "folders/12345678" + } + prefix = "prefix" +} +# tftest modules=10 resources=50 +``` diff --git a/blueprints/data-solutions/cmek-via-centralized-kms/README.md b/blueprints/data-solutions/cmek-via-centralized-kms/README.md index 3813c90c2f..ab80d5ff8e 100644 --- a/blueprints/data-solutions/cmek-via-centralized-kms/README.md +++ b/blueprints/data-solutions/cmek-via-centralized-kms/README.md @@ -54,3 +54,17 @@ This sample creates several distinct groups of resources: | [vm_keys](outputs.tf#L41) | GCE VM Cloud KMS crypto keys. | | + +## Test + +```hcl +module "test" { + source = "./fabric/blueprints/data-solutions/cmek-via-centralized-kms/" + project_config = { + billing_account_id = "123456-123456-123456" + parent = "folders/12345678" + } + prefix = "prefix" +} +# tftest modules=8 resources=27 +``` diff --git a/blueprints/data-solutions/composer-2/README.md b/blueprints/data-solutions/composer-2/README.md index bc51aaa4fb..6ff0e8b08a 100644 --- a/blueprints/data-solutions/composer-2/README.md +++ b/blueprints/data-solutions/composer-2/README.md @@ -113,3 +113,18 @@ service_encryption_keys = { | [composer_dag_gcs](outputs.tf#L22) | The Cloud Storage prefix of the DAGs for the Cloud Composer environment. | | + +## Test + +```hcl +module "test" { + source = "./fabric/blueprints/data-solutions/composer-2/" + project_id = "project" + project_create = { + billing_account_id = "123456-123456-123456" + parent = "folders/12345678" + } + prefix = "prefix" +} +# tftest modules=5 resources=26 +``` diff --git a/blueprints/data-solutions/data-playground/README.md b/blueprints/data-solutions/data-playground/README.md index db7d51fce0..2e71944505 100644 --- a/blueprints/data-solutions/data-playground/README.md +++ b/blueprints/data-solutions/data-playground/README.md @@ -68,3 +68,18 @@ You can now connect to the Vertex AI notbook to perform your data analysy. | [vpc](outputs.tf#L38) | VPC Network. | | + +## Test + +```hcl +module "test" { + source = "./fabric/blueprints/data-solutions/data-playground" + project_id = "sampleproject" + prefix = "tst" + project_create = { + billing_account_id = "123456-123456-123456", + parent = "folders/467898377" + } +} +# tftest modules=8 resources=39 +``` diff --git a/blueprints/data-solutions/gcs-to-bq-with-least-privileges/README.md b/blueprints/data-solutions/gcs-to-bq-with-least-privileges/README.md index 54f47ecab5..eefb5e868c 100644 --- a/blueprints/data-solutions/gcs-to-bq-with-least-privileges/README.md +++ b/blueprints/data-solutions/gcs-to-bq-with-least-privileges/README.md @@ -215,3 +215,18 @@ The above command will delete the associated resources so there will be no billa | [service_accounts](outputs.tf#L69) | Service account. | | + +## Test + +```hcl +module "test" { + source = "./fabric/blueprints/data-solutions/gcs-to-bq-with-least-privileges/" + project_create = { + billing_account_id = "123456-123456-123456" + parent = "folders/12345678" + } + project_id = "project-1" + prefix = "prefix" +} +# tftest modules=12 resources=47 +``` diff --git a/blueprints/data-solutions/shielded-folder/README.md b/blueprints/data-solutions/shielded-folder/README.md index aaf67e6acd..5496eaa74b 100644 --- a/blueprints/data-solutions/shielded-folder/README.md +++ b/blueprints/data-solutions/shielded-folder/README.md @@ -178,3 +178,33 @@ terraform apply | [folders_sink_writer_identities](outputs.tf#L23) | Folders id. | | + +## Test + +```hcl +module "test" { + source = "./fabric/blueprints/data-solutions/shielded-folder" + data_dir = "./fabric/blueprints/data-solutions/shielded-folder/data" + access_policy_config = { + access_policy_create = { + parent = "organizations/1234567890123" + title = "ShieldedMVP" + } + } + folder_config = { + folder_create = { + display_name = "ShieldedMVP" + parent = "organizations/1234567890123" + } + } + organization = { + domain = "example.com" + id = "1122334455" + } + prefix = "prefix" + project_config = { + billing_account_id = "123456-123456-123456" + } +} +# tftest modules=6 resources=38 inventory=simple.yaml +``` diff --git a/blueprints/data-solutions/sqlserver-alwayson/README.md b/blueprints/data-solutions/sqlserver-alwayson/README.md index 1ce4dad7d4..695c8f0bbc 100644 --- a/blueprints/data-solutions/sqlserver-alwayson/README.md +++ b/blueprints/data-solutions/sqlserver-alwayson/README.md @@ -69,3 +69,23 @@ and to `C:\GcpSetupLog.txt` file. | [instructions](outputs.tf#L19) | List of steps to follow after applying. | | + +## Test + +```hcl +module "test" { + source = "./fabric/blueprints/data-solutions/sqlserver-alwayson/" + project_create = { + billing_account_id = "123456-123456-123456" + parent = "folders/12345678" + } + project_id = "project-1" + prefix = "test" + network = "example-network" + subnetwork = "example-subnetwork" + sql_admin_password = "password" + ad_domain_fqdn = "ad.example.com" + ad_domain_netbios = "ad" +} +# tftest modules=12 resources=38 +``` diff --git a/blueprints/data-solutions/vertex-mlops/README.md b/blueprints/data-solutions/vertex-mlops/README.md index d9f85fd837..dc2c74cd71 100644 --- a/blueprints/data-solutions/vertex-mlops/README.md +++ b/blueprints/data-solutions/vertex-mlops/README.md @@ -74,6 +74,35 @@ This blueprint can be used as a building block for setting up an end2end ML Ops | [project_id](outputs.tf#L49) | Project ID. | | -# TODO +## TODO - Add support for User Managed Notebooks, SA permission option and non default SA for Single User mode. -- Improve default naming for local VPC and Cloud NAT \ No newline at end of file +- Improve default naming for local VPC and Cloud NAT + +## Test + +```hcl +module "test" { + source = "./fabric/blueprints/data-solutions/vertex-mlops/" + labels = { + "env" : "dev", + "team" : "ml" + } + bucket_name = "test-dev" + dataset_name = "test" + identity_pool_claims = "attribute.repository/ORGANIZATION/REPO" + notebooks = { + "myworkbench" : { + "owner" : "user@example.com", + "region" : "europe-west4", + "subnet" : "default", + } + } + prefix = "pref" + project_id = "test-dev" + project_create = { + billing_account_id = "000000-123456-123456" + parent = "folders/111111111111" + } +} +# tftest modules=12 resources=56 +``` diff --git a/tests/blueprints/data_solutions/__init__.py b/tests/blueprints/data_solutions/__init__.py deleted file mode 100644 index 6d6d1266c3..0000000000 --- a/tests/blueprints/data_solutions/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/tests/blueprints/data_solutions/cloudsql_multiregion/__init__.py b/tests/blueprints/data_solutions/cloudsql_multiregion/__init__.py deleted file mode 100644 index 6d6d1266c3..0000000000 --- a/tests/blueprints/data_solutions/cloudsql_multiregion/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/tests/blueprints/data_solutions/cloudsql_multiregion/fixture/main.tf b/tests/blueprints/data_solutions/cloudsql_multiregion/fixture/main.tf deleted file mode 100644 index 3d71614976..0000000000 --- a/tests/blueprints/data_solutions/cloudsql_multiregion/fixture/main.tf +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module "test" { - source = "../../../../../blueprints/data-solutions/cloudsql-multiregion/" - data_eng_principals = ["dataeng@example.com"] - postgres_user_password = "my-root-password" - project_id = "project" - project_create = { - billing_account_id = "123456-123456-123456" - parent = "folders/12345678" - } - prefix = "prefix" -} diff --git a/tests/blueprints/data_solutions/cloudsql_multiregion/test_plan.py b/tests/blueprints/data_solutions/cloudsql_multiregion/test_plan.py deleted file mode 100644 index 90371cf7c7..0000000000 --- a/tests/blueprints/data_solutions/cloudsql_multiregion/test_plan.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -def test_resources(e2e_plan_runner): - "Test that plan works and the numbers of resources is as expected." - modules, resources = e2e_plan_runner() - assert len(modules) == 9 - assert len(resources) == 48 diff --git a/tests/blueprints/data_solutions/cmek_via_centralized_kms/__init__.py b/tests/blueprints/data_solutions/cmek_via_centralized_kms/__init__.py deleted file mode 100644 index 6d6d1266c3..0000000000 --- a/tests/blueprints/data_solutions/cmek_via_centralized_kms/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/tests/blueprints/data_solutions/cmek_via_centralized_kms/fixture/main.tf b/tests/blueprints/data_solutions/cmek_via_centralized_kms/fixture/main.tf deleted file mode 100644 index 3fee8af5f0..0000000000 --- a/tests/blueprints/data_solutions/cmek_via_centralized_kms/fixture/main.tf +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module "test" { - source = "../../../../../blueprints/data-solutions/cmek-via-centralized-kms/" - project_config = { - billing_account_id = "123456-123456-123456" - parent = "folders/12345678" - } - prefix = "prefix" -} diff --git a/tests/blueprints/data_solutions/cmek_via_centralized_kms/test_plan.py b/tests/blueprints/data_solutions/cmek_via_centralized_kms/test_plan.py deleted file mode 100644 index 22d474b431..0000000000 --- a/tests/blueprints/data_solutions/cmek_via_centralized_kms/test_plan.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -def test_resources(e2e_plan_runner): - "Test that plan works and the numbers of resources is as expected." - modules, resources = e2e_plan_runner() - assert len(modules) == 7 - assert len(resources) == 27 diff --git a/tests/blueprints/data_solutions/composer_2/__init__.py b/tests/blueprints/data_solutions/composer_2/__init__.py deleted file mode 100644 index 6d6d1266c3..0000000000 --- a/tests/blueprints/data_solutions/composer_2/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/tests/blueprints/data_solutions/composer_2/fixture/main.tf b/tests/blueprints/data_solutions/composer_2/fixture/main.tf deleted file mode 100644 index 4b35e6f80e..0000000000 --- a/tests/blueprints/data_solutions/composer_2/fixture/main.tf +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module "test" { - source = "../../../../../blueprints/data-solutions/composer-2/" - project_id = "project" - - project_create = { - billing_account_id = "123456-123456-123456" - parent = "folders/12345678" - } - prefix = "prefix" -} diff --git a/tests/blueprints/data_solutions/composer_2/test_plan.py b/tests/blueprints/data_solutions/composer_2/test_plan.py deleted file mode 100644 index 04f4a39f71..0000000000 --- a/tests/blueprints/data_solutions/composer_2/test_plan.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -def test_resources(e2e_plan_runner): - "Test that plan works and the numbers of resources is as expected." - modules, resources = e2e_plan_runner() - assert len(modules) == 4 - assert len(resources) == 25 diff --git a/tests/blueprints/data_solutions/data_playground/__init__.py b/tests/blueprints/data_solutions/data_playground/__init__.py deleted file mode 100644 index 6d6d1266c3..0000000000 --- a/tests/blueprints/data_solutions/data_playground/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/tests/blueprints/data_solutions/data_playground/fixture/main.tf b/tests/blueprints/data_solutions/data_playground/fixture/main.tf deleted file mode 100644 index e9e1d29798..0000000000 --- a/tests/blueprints/data_solutions/data_playground/fixture/main.tf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module "test" { - source = "../../../../../blueprints/data-solutions/data-playground/" - project_id = "sampleproject" - prefix = "tst" - project_create = { - billing_account_id = "123456-123456-123456", - parent = "folders/467898377" - } -} diff --git a/tests/blueprints/data_solutions/data_playground/test_plan.py b/tests/blueprints/data_solutions/data_playground/test_plan.py deleted file mode 100644 index daaa57fc96..0000000000 --- a/tests/blueprints/data_solutions/data_playground/test_plan.py +++ /dev/null @@ -1,25 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import pytest - -FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixture') - - -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) == 7 - assert len(resources) == 38 diff --git a/tests/blueprints/data_solutions/gcs_to_bq_with_least_privileges/__init__.py b/tests/blueprints/data_solutions/gcs_to_bq_with_least_privileges/__init__.py deleted file mode 100644 index 6d6d1266c3..0000000000 --- a/tests/blueprints/data_solutions/gcs_to_bq_with_least_privileges/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/tests/blueprints/data_solutions/gcs_to_bq_with_least_privileges/fixture/main.tf b/tests/blueprints/data_solutions/gcs_to_bq_with_least_privileges/fixture/main.tf deleted file mode 100644 index 4fc83c755b..0000000000 --- a/tests/blueprints/data_solutions/gcs_to_bq_with_least_privileges/fixture/main.tf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module "test" { - source = "../../../../../blueprints/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/blueprints/data_solutions/gcs_to_bq_with_least_privileges/fixture/variables.tf b/tests/blueprints/data_solutions/gcs_to_bq_with_least_privileges/fixture/variables.tf deleted file mode 100644 index 477dcaf792..0000000000 --- a/tests/blueprints/data_solutions/gcs_to_bq_with_least_privileges/fixture/variables.tf +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -variable "prefix" { - description = "Unique prefix used for resource names. Not used for project if 'project_create' is null." - type = string - default = "prefix" -} - -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 "project_id" { - description = "Project id, references existing project if `project_create` is null." - type = string - default = "datalake" -} diff --git a/tests/blueprints/data_solutions/gcs_to_bq_with_least_privileges/test_plan.py b/tests/blueprints/data_solutions/gcs_to_bq_with_least_privileges/test_plan.py deleted file mode 100644 index 773e80ca17..0000000000 --- a/tests/blueprints/data_solutions/gcs_to_bq_with_least_privileges/test_plan.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import os -import pytest - - -FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixture') - - -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) == 47 diff --git a/tests/blueprints/data_solutions/shielded_folder/simple.yaml b/tests/blueprints/data_solutions/shielded_folder/examples/simple.yaml similarity index 78% rename from tests/blueprints/data_solutions/shielded_folder/simple.yaml rename to tests/blueprints/data_solutions/shielded_folder/examples/simple.yaml index 244dcb976e..23bc8b7a09 100644 --- a/tests/blueprints/data_solutions/shielded_folder/simple.yaml +++ b/tests/blueprints/data_solutions/shielded_folder/examples/simple.yaml @@ -13,18 +13,18 @@ # limitations under the License. values: - module.folder.google_compute_firewall_policy.policy["prefix-fw-policy"]: + module.test.module.folder.google_compute_firewall_policy.policy["prefix-fw-policy"]: short_name: prefix-fw-policy - module.folder.google_folder.folder[0]: + module.test.module.folder.google_folder.folder[0]: display_name: ShieldedMVP parent: organizations/1234567890123 - module.log-export-project[0].google_project.project[0]: + module.test.module.log-export-project[0].google_project.project[0]: billing_account: 123456-123456-123456 project_id: prefix-audit-logs - module.vpc-sc[0].google_access_context_manager_access_policy.default[0]: + module.test.module.vpc-sc[0].google_access_context_manager_access_policy.default[0]: parent: organizations/1122334455 title: shielded-folder - module.vpc-sc[0].google_access_context_manager_service_perimeter.regular["shielded"]: + module.test.module.vpc-sc[0].google_access_context_manager_service_perimeter.regular["shielded"]: description: null perimeter_type: PERIMETER_TYPE_REGULAR title: shielded @@ -47,5 +47,5 @@ counts: google_project_service_identity: 1 google_projects: 1 google_storage_project_service_account: 1 - modules: 5 + modules: 6 resources: 38 diff --git a/tests/blueprints/data_solutions/shielded_folder/simple.tfvars b/tests/blueprints/data_solutions/shielded_folder/simple.tfvars deleted file mode 100644 index 83e8b1399c..0000000000 --- a/tests/blueprints/data_solutions/shielded_folder/simple.tfvars +++ /dev/null @@ -1,20 +0,0 @@ -access_policy_config = { - access_policy_create = { - parent = "organizations/1234567890123" - title = "ShieldedMVP" - } -} -folder_config = { - folder_create = { - display_name = "ShieldedMVP" - parent = "organizations/1234567890123" - } -} -organization = { - domain = "example.com" - id = "1122334455" -} -prefix = "prefix" -project_config = { - billing_account_id = "123456-123456-123456" -} diff --git a/tests/blueprints/data_solutions/shielded_folder/tftest.yaml b/tests/blueprints/data_solutions/shielded_folder/tftest.yaml deleted file mode 100644 index 3c0bcb8c42..0000000000 --- a/tests/blueprints/data_solutions/shielded_folder/tftest.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module: blueprints/data-solutions/shielded-folder - -tests: - simple: diff --git a/tests/blueprints/data_solutions/sqlserver_alwayson/__init__.py b/tests/blueprints/data_solutions/sqlserver_alwayson/__init__.py deleted file mode 100644 index 6d6d1266c3..0000000000 --- a/tests/blueprints/data_solutions/sqlserver_alwayson/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/tests/blueprints/data_solutions/sqlserver_alwayson/fixture/main.tf b/tests/blueprints/data_solutions/sqlserver_alwayson/fixture/main.tf deleted file mode 100644 index 72f7a7d337..0000000000 --- a/tests/blueprints/data_solutions/sqlserver_alwayson/fixture/main.tf +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module "test" { - source = "../../../../../blueprints/data-solutions/sqlserver-alwayson/" - project_create = var.project_create - project_id = var.project_id - prefix = var.prefix - network = "example-network" - subnetwork = "example-subnetwork" - sql_admin_password = "password" - ad_domain_fqdn = "ad.example.com" - ad_domain_netbios = "ad" -} diff --git a/tests/blueprints/data_solutions/sqlserver_alwayson/fixture/variables.tf b/tests/blueprints/data_solutions/sqlserver_alwayson/fixture/variables.tf deleted file mode 100644 index e2c50ac27c..0000000000 --- a/tests/blueprints/data_solutions/sqlserver_alwayson/fixture/variables.tf +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -variable "prefix" { - description = "Unique prefix used for resource names." - type = string - default = "test" -} - -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 "project_id" { - description = "Project id, references existing project if `project_create` is null." - type = string - default = "sqlserver" -} diff --git a/tests/blueprints/data_solutions/sqlserver_alwayson/test_plan.py b/tests/blueprints/data_solutions/sqlserver_alwayson/test_plan.py deleted file mode 100644 index 863148007d..0000000000 --- a/tests/blueprints/data_solutions/sqlserver_alwayson/test_plan.py +++ /dev/null @@ -1,25 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import pytest - -FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixture') - - -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) == 38 diff --git a/tests/blueprints/data_solutions/vertex_mlops/__init__.py b/tests/blueprints/data_solutions/vertex_mlops/__init__.py deleted file mode 100644 index 6d6d1266c3..0000000000 --- a/tests/blueprints/data_solutions/vertex_mlops/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/tests/blueprints/data_solutions/vertex_mlops/fixture/main.tf b/tests/blueprints/data_solutions/vertex_mlops/fixture/main.tf deleted file mode 100644 index 0b671f3355..0000000000 --- a/tests/blueprints/data_solutions/vertex_mlops/fixture/main.tf +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module "projects" { - source = "../../../../../blueprints/data-solutions/vertex-mlops/" - labels = { - "env" : "dev", - "team" : "ml" - } - bucket_name = "test-dev" - dataset_name = "test" - identity_pool_claims = "attribute.repository/ORGANIZATION/REPO" - notebooks = { - "myworkbench" : { - "owner" : "user@example.com", - "region" : "europe-west4", - "subnet" : "default", - } - } - prefix = "pref" - project_id = "test-dev" - project_create = { - billing_account_id = "000000-123456-123456" - parent = "folders/111111111111" - } -} diff --git a/tests/blueprints/data_solutions/vertex_mlops/test_plan.py b/tests/blueprints/data_solutions/vertex_mlops/test_plan.py deleted file mode 100644 index eac30ad57f..0000000000 --- a/tests/blueprints/data_solutions/vertex_mlops/test_plan.py +++ /dev/null @@ -1,23 +0,0 @@ -# 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import os -import pytest - -FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixture') - -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) - # TODO: to re-enable per-module resource count check print _, then test - assert len(modules) > 0 and len(resources) > 0 \ No newline at end of file