terraform-google-modules/terraform-google-project-factory

Error: Unreadable module directory - The directory .terraform/modules/host-project/modules/project_factory_shared_vpc could not be read.

Opened this issue · 1 comments

TL;DR

$ terraform init

Initializing the backend...
Initializing modules...
Downloading registry.terraform.io/terraform-google-modules/project-factory/google 17.0.0 for host-project...
- host-project in .terraform/modules/host-project/modules/project_factory_shared_vpc
╷
│ Error: Unreadable module directory
│ 
│ The directory .terraform/modules/host-project/modules/project_factory_shared_vpc could not be read. This is a bug in Terraform and should be reported.
╵

Expected behavior

$ terraform init

Initializing the backend...
Initializing modules...
Downloading registry.terraform.io/terraform-google-modules/project-factory/google 17.0.0 for project-factory...
- project-factory in .terraform/modules/project-factory
- project-factory.budget in .terraform/modules/project-factory/modules/budget
- project-factory.essential_contacts in .terraform/modules/project-factory/modules/essential_contacts
- project-factory.gsuite_group in .terraform/modules/project-factory/modules/gsuite_group
- project-factory.project-factory in .terraform/modules/project-factory/modules/core_project_factory
- project-factory.project-factory.project_services in .terraform/modules/project-factory/modules/project_services
- project-factory.quotas in .terraform/modules/project-factory/modules/quota_manager
- project-factory.shared_vpc_access in .terraform/modules/project-factory/modules/shared_vpc_access

Initializing provider plugins...
- Finding hashicorp/google versions matching ">= 3.43.0, >= 4.28.0, >= 5.41.0, < 7.0.0"...
- Finding hashicorp/google-beta versions matching ">= 3.43.0, >= 4.11.0, >= 5.41.0, < 7.0.0"...
- Finding hashicorp/null versions matching ">= 2.1.0"...
- Finding hashicorp/random versions matching ">= 2.2.0"...
- Finding hashicorp/time versions matching ">= 0.5.0"...
- Installing hashicorp/google v6.5.0...
- Installed hashicorp/google v6.5.0 (signed by HashiCorp)
- Installing hashicorp/google-beta v6.5.0...
- Installed hashicorp/google-beta v6.5.0 (signed by HashiCorp)
- Installing hashicorp/null v3.2.3...
- Installed hashicorp/null v3.2.3 (signed by HashiCorp)
- Installing hashicorp/random v3.6.3...
- Installed hashicorp/random v3.6.3 (signed by HashiCorp)
- Installing hashicorp/time v0.12.1...
- Installed hashicorp/time v0.12.1 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

Observed behavior

Downloading registry.terraform.io/terraform-google-modules/project-factory/google 16.0.1 for host-project...
- host-project in .terraform/modules/host-project/modules/project_factory_shared_vpc
╷
│ Error: Unreadable module directory
│ 
│ The directory .terraform/modules/host-project/modules/project_factory_shared_vpc could not be read. This is a bug in Terraform and should be reported.
╵

Terraform Configuration

This one works as expected: https://github.com/terraform-google-modules/terraform-google-project-factory/tree/master/examples/simple_project

This one results in the above error: https://github.com/terraform-google-modules/terraform-google-project-factory/tree/master/examples/shared_vpc

Terraform Version

v1.9.7

Additional information

No response

Sorry, I had a copy/paste issue in my environment. I see that the module name has a typo in it. Sorry about that!