Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inter module dependency issues with Project Factory #15

Closed
throw-away-git opened this issue Oct 9, 2018 · 3 comments
Closed

Inter module dependency issues with Project Factory #15

throw-away-git opened this issue Oct 9, 2018 · 3 comments
Assignees

Comments

@throw-away-git
Copy link

I use Google Network module with Project Factory, when I try destroy all resources I receive following errors.

.............................
module.host_project01.google_project_service.project_services: Destruction complete after 14smodule.host-project01-network.google_compute_subnetwork.subnetwork.0: Still destroying... (ID:
europe-west2/subnet-01, 30s elapsed)module.host-project01-network.google_compute_subnetwork.subnetwork.1: Still destroying... (ID:
europe-west2/subnet-02, 30s elapsed)module.host-project01-network.google_compute_subnetwork.subnetwork.2: Still destroying... (ID:
europe-west2/subnet-03, 30s elapsed)module.host-project01-network.google_compute_subnetwork.subnetwork.3: Still destroying... (ID:
europe-west2/subnet-04, 30s elapsed)
Error: Error applying plan:

4 error(s) occurred:

* module.host-project01-network.google_compute_subnetwork.subnetwork[1] (destroy): 1 error(s) occurred:
* google_compute_subnetwork.subnetwork.1: Error waiting for Deleting Subnetwork: googleapi: Error 403: Access Not Configured. Compute Engine API has not been used in project 3324343423423423 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/compute.googleapis.com/overview?project=3324343423423423 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured* module.host-project01-network.google_compute_subnetwork.subnetwork[2] (destroy): 1 error(s) occurred:
* google_compute_subnetwork.subnetwork.2: Error waiting for Deleting Subnetwork: googleapi: Error 403: Access Not Configured. Compute Engine API has not been used in project 3324343423423423 
 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/compute.googleapis.com/overview?project=3324343423423423 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured* module.host-project01-network.google_compute_subnetwork.subnetwork[3] (destroy): 1 error(s) occurred:

Following "module.host_project01.google_project_service.project_services" resource destroy I receive this error.

My templates contains following resources,

module "host-project01-network" {
  source          = "/modules/google-network"
  project_id      = "${module.host_project01.project_id}"
  network_name    = "host-vpc-network"
  routing_mode    = "REGIONAL"
  shared_vpc_host = "true"

  subnets = [
    {......................


module "host_project01" {
  source            = "/modules/project-factory"
  random_project_id = "true"
  name              = "host-project-01"
  org_id            = "${var.organization_id}"
  billing_account   = "${var.billing_account}"
  activate_apis     = ["compute.googleapis.com"]
  credentials_path  = "${local.credentials_file_path}"
}

I expect project_id = "${module.host_project01.project_id}" line to create an implicit dependency between network and project factory modules and Terraform will destroy resources in a suitable order to respect dependencies but it seems doesn't work.

@ocervell
Copy link
Contributor

@adrienthebo just ran into this

@morgante
Copy link
Contributor

morgante commented Mar 4, 2019

This is probably best addressed as an update to project-factory. I suspect the underling issue is that ${module.host_project01.project_id} doesn't depend on the API activation in project factory.

@3thanZ
Copy link

3thanZ commented Apr 2, 2019

I'm with @morgante. Can this be solved with #37?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants