Update asset-inventory-feed-remediation tests

This commit is contained in:
Julio Castillo 2023-02-08 21:42:15 +01:00
parent f777e97cef
commit 7c17af66aa
9 changed files with 34 additions and 78 deletions

View File

@ -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. | |
<!-- END TFDOC -->
## 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
```

View File

@ -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

View File

@ -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.

View File

@ -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. | |
<!-- END TFDOC -->
## 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
```

View File

@ -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.

View File

@ -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
}

View File

@ -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"
}

View File

@ -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