Skip to content

Commit

Permalink
fix: switch svpc access to explicit dep on service enablement (#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathkkb committed Aug 28, 2024
1 parent 1f1fbc3 commit 105be42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,15 @@ module "shared_vpc_access" {
enable_shared_vpc_service_project = var.svpc_host_project_id != "" ? true : false
host_project_id = var.svpc_host_project_id
service_project_id = module.project-factory.project_id
active_apis = module.project-factory.enabled_apis
active_apis = var.activate_apis
shared_vpc_subnets = var.shared_vpc_subnets
service_project_number = module.project-factory.project_number
lookup_project_numbers = false
grant_services_security_admin_role = var.grant_services_security_admin_role
grant_network_role = var.grant_network_role
# Workaround for import complaining about count cannot determine resource instances
# until apply. https://github.com/hashicorp/terraform/issues/24690
depends_on = [module.project-factory.enabled_apis]
}

/******************************************
Expand Down
5 changes: 4 additions & 1 deletion modules/svpc_service_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ module "shared_vpc_access" {
host_project_id = var.shared_vpc
enable_shared_vpc_service_project = true
service_project_id = module.project-factory.project_id
active_apis = module.project-factory.enabled_apis
active_apis = var.activate_apis
shared_vpc_subnets = var.shared_vpc_subnets
service_project_number = module.project-factory.project_number
lookup_project_numbers = false
grant_services_security_admin_role = var.grant_services_security_admin_role
grant_network_role = var.grant_network_role
# Workaround for import complaining about count cannot determine resource instances
# until apply. https://github.com/hashicorp/terraform/issues/24690
depends_on = [module.project-factory.enabled_apis]
}

/******************************************
Expand Down

0 comments on commit 105be42

Please sign in to comment.