hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.33k stars 1.73k forks source link

[Project factory] API dependency causing issues in terraform destroy #9597

Closed vishramyadav-g closed 3 years ago

vishramyadav-g commented 3 years ago

Community Note

Description

Project factory module has the option to provide APIs to be enabled. When dependent and parent APIs (which have dependent APIs) are provided as input, running terraform destroy fails.

Error

Error: Error when reading or editing Project Service prj-busunit-code-tool-d-e7d6/storage-api.googleapis.com: Error disabling service "storage-api.googleapis.com" for project "prj-busunit-code-tool-d-e7d6": Error waiting for api to disable: Error code 5, message: [Hook call/poll failed for service "file.googleapis.com".

Terraform Version

Terraform version: 0.13.6

Affected Resource(s)

Terraform Configuration Files

# Copy-paste your Terraform configurations here.
#
# For large Terraform configs, please use a service like Dropbox and share a link to the ZIP file.
# For security, you can also encrypt the files using our GPG public key:
#    https://www.hashicorp.com/security
#
# If reproducing the bug involves modifying the config file (e.g., apply a config,
# change a value, apply the config again, see the bug), then please include both:
# * the version of the config before the change, and
# * the version of the config after the change.

Debug Output

(Github gist : Debug logs)[https://gist.github.com/vishramyadav-g/88e8242606d7153295d262724fbcf400]

Panic Output

Expected Behavior

Project should be deleted without any error.

Actual Behavior

API could not disable before the project deletion.

Steps to Reproduce

  1. Configure project factory module to create a project with dependent and independent APIs.
  2. Run terraform apply
  3. Run terraform destroy (On created project)

Important Factoids

Other derails

Google provider version: google v3.61.0, google-beta v3.61.0 CFT version: 11.1.0 ( Can be reproduced with 10.3.2 as well, seems version agnostic ) Activated API: "bigquery.googleapis.com", "bigquerystorage.googleapis.com", "cloudapis.googleapis.com", "cloudbilling.googleapis.com", "cloudbuild.googleapis.com", "cloudkms.googleapis.com", "cloudresourcemanager.googleapis.com", "compute.googleapis.com", "container.googleapis.com", "containerregistry.googleapis.com", "deploymentmanager.googleapis.com", "dns.googleapis.com", "eventarc.googleapis.com", "file.googleapis.com", "iam.googleapis.com", "iamcredentials.googleapis.com", "iap.googleapis.com", "logging.googleapis.com", "monitoring.googleapis.com", "networkmanagement.googleapis.com", "oslogin.googleapis.com", "run.googleapis.com", "runtimeconfig.googleapis.com", "secretmanager.googleapis.com", "securitycenter.googleapis.com", "servicemanagement.googleapis.com", "serviceusage.googleapis.com", "stackdriver.googleapis.com", "storage-api.googleapis.com", "storage-component.googleapis.com", "storage.googleapis.com", "vpcaccess.googleapis.com", "websecurityscanner.googleapis.com",

References

maitreya-source commented 3 years ago
github-actions[bot] commented 3 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.