diff --git a/blueprints/cloud-operations/asset-inventory-feed-remediation/README.md b/blueprints/cloud-operations/asset-inventory-feed-remediation/README.md index fdbda73b..1025a6be 100644 --- a/blueprints/cloud-operations/asset-inventory-feed-remediation/README.md +++ b/blueprints/cloud-operations/asset-inventory-feed-remediation/README.md @@ -72,3 +72,15 @@ Run the `subscription_pull` command until it returns nothing, then run the follo | [tag_show](outputs.tf#L49) | Instance add tag command. | | + +## Test + +```hcl +module "test" { + source = "./fabric/blueprints/cloud-operations/asset-inventory-feed-remediation" + project_create = true + project_id = "project-1" +} + +# tftest modules=7 resources=21 +``` diff --git a/blueprints/cloud-operations/asset-inventory-feed-remediation/main.tf b/blueprints/cloud-operations/asset-inventory-feed-remediation/main.tf index 6fc1948e..163fc0f1 100644 --- a/blueprints/cloud-operations/asset-inventory-feed-remediation/main.tf +++ b/blueprints/cloud-operations/asset-inventory-feed-remediation/main.tf @@ -1,5 +1,5 @@ /** - * Copyright 2022 Google LLC + * 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. @@ -82,7 +82,7 @@ module "cf" { location = var.region } bundle_config = { - source_dir = "cf" + source_dir = "${path.module}/cf" output_path = var.bundle_path } service_account = module.service-account.email diff --git a/blueprints/cloud-operations/terraform-cloud-dynamic-credentials/README.md b/blueprints/cloud-operations/terraform-cloud-dynamic-credentials/README.md index 3cec722e..46f90ea8 100644 --- a/blueprints/cloud-operations/terraform-cloud-dynamic-credentials/README.md +++ b/blueprints/cloud-operations/terraform-cloud-dynamic-credentials/README.md @@ -120,3 +120,4 @@ terraform apply As a result we have a successfully deployed GCS bucket from Terraform Cloud workflow using Workload Identity Federation. Once done testing, you can clean up resources by running `terraform destroy` first in the `tfc-workflow-using-wif` and then `gcp-workload-identity-provider` folders. + diff --git a/blueprints/cloud-operations/terraform-cloud-dynamic-credentials/gcp-workload-identity-provider/README.md b/blueprints/cloud-operations/terraform-cloud-dynamic-credentials/gcp-workload-identity-provider/README.md index a7dfac57..4f5b7227 100644 --- a/blueprints/cloud-operations/terraform-cloud-dynamic-credentials/gcp-workload-identity-provider/README.md +++ b/blueprints/cloud-operations/terraform-cloud-dynamic-credentials/gcp-workload-identity-provider/README.md @@ -33,3 +33,22 @@ The codebase provisions the following list of resources: | [tfc_workspace_wariables](outputs.tf#L20) | Variables to be set on the TFC workspace. | | + +## Test + +```hcl +module "test" { + source = "./fabric/blueprints/cloud-operations/terraform-enterprise-wif/gcp-workload-identity-provider" + billing_account = "1234-ABCD-1234" + project_create = true + project_id = "project-1" + parent = "folders/12345" + tfe_organization_id = "org-123" + tfe_workspace_id = "ws-123" + workload_identity_pool_id = "tfe-pool" + workload_identity_pool_provider_id = "tf-provider" + issuer_uri = "https://app.terraform.io/" +} + +# tftest modules=3 resources=12 +``` diff --git a/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/__init__.py b/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/__init__.py deleted file mode 100644 index 6d6d1266..00000000 --- a/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/__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/cloud_operations/asset_inventory_feed_remediation/fixture/cf/README b/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/fixture/cf/README deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/fixture/main.tf b/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/fixture/main.tf deleted file mode 100644 index 83f86c96..00000000 --- a/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/fixture/main.tf +++ /dev/null @@ -1,21 +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/cloud-operations/asset-inventory-feed-remediation" - project_create = var.project_create - project_id = var.project_id -} diff --git a/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/fixture/variables.tf b/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/fixture/variables.tf deleted file mode 100644 index 3d884c25..00000000 --- a/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/fixture/variables.tf +++ /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 -# -# https://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 "project_create" { - type = bool - default = true -} - -variable "project_id" { - type = string - default = "project-1" -} diff --git a/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/test_plan.py b/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/test_plan.py deleted file mode 100644 index 497af6be..00000000 --- a/tests/blueprints/cloud_operations/asset_inventory_feed_remediation/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) == 6 - assert len(resources) == 19