cloud-foundation-fabric icon indicating copy to clipboard operation
cloud-foundation-fabric copied to clipboard

FAST - project factory, default value host_project from 02-networking appears not to be used.

Open mgfeller opened this issue 2 years ago • 1 comments

I'd expect that if vpc.host_project: null in e.g. data/projects/project.yaml, and 02-networking.auto.tfvars.json is made available, the host project id would be picked up from 02-networking.auto.tfvars.json in main.locals._defaults_net and subsequently used?

I'm using a copy of examples/factories/project-factory.

This appears not to be the case. The following errors occur on terraform plan:

│ Error: Missing required argument
│
│   with module.projects["dev-managed-gke"].module.project.google_project_iam_member.shared_vpc_host_robots["roles/compute.networkUser:cloudservices"],
│   on .terraform/modules/projects.project/project/shared-vpc.tf line 69, in resource "google_project_iam_member" "shared_vpc_host_robots":
│   69:   project  = var.shared_vpc_service_config.host_project
│
│ The argument "project" is required, but no definition was found.
╵
╷
│ Error: Missing required argument
│
│   with module.projects["dev-managed-gke"].module.project.google_project_iam_member.shared_vpc_host_robots["roles/container.hostServiceAgentUser:container-engine"],
│   on .terraform/modules/projects.project/project/shared-vpc.tf line 69, in resource "google_project_iam_member" "shared_vpc_host_robots":
│   69:   project  = var.shared_vpc_service_config.host_project
│
│ The argument "project" is required, but no definition was found.
╵
╷
│ Error: Missing required argument
│
│   with module.projects["dev-managed-gke"].module.project.google_project_iam_member.shared_vpc_host_robots["roles/compute.networkUser:container-engine"],
│   on .terraform/modules/projects.project/project/shared-vpc.tf line 69, in resource "google_project_iam_member" "shared_vpc_host_robots":
│   69:   project  = var.shared_vpc_service_config.host_project
│
│ The argument "project" is required, but no definition was found.

mgfeller avatar Jul 06 '22 07:07 mgfeller

Hey Micheal - thanks a ton for the feedback. I have verified that local._defaults_net.vpc_host_project coming from 02-networking.auto.tfvars.json is not being used in the shared VPC setup. I'll try to find some time to refactor those bits in the coming days - the VPC setup is a bit convoluted and could be done better.

sruffilli avatar Jul 06 '22 13:07 sruffilli

Obsoleted by #1264

sruffilli avatar Jul 04 '23 07:07 sruffilli