Introduce separate networking submodule#25
Conversation
kay-kim
left a comment
There was a problem hiding this comment.
will make changes to the docs about providers.
| google = google | ||
| kubernetes = kubernetes | ||
| helm = helm | ||
| } |
There was a problem hiding this comment.
Below in the output section, should we add the output "network" { section?
jubrad
left a comment
There was a problem hiding this comment.
One questions, otherwise looks good
| google_service_networking_connection.private_vpc_connection, | ||
| google_compute_subnetwork.subnet, | ||
| google_compute_route.default_route | ||
| var.network_dependency # This ensures the network is created first |
There was a problem hiding this comment.
Shouldn't the gke module dependency on the networking dependency also ensure the network is created first?
I'm guessing you wouldn't have done this if it did, but that's weird.
There was a problem hiding this comment.
Good point, just tested this without the extra redundancy of the network_dependency var and it works well as well.
| create_before_destroy = true | ||
| } | ||
|
|
||
| deletion_policy = "ABANDON" |
There was a problem hiding this comment.
We initially added that as we’ve hit an issue in CI where the VPC peering gets deleted before its dependent resources (like Cloud SQL or GKE), which causes the destroy to fail.
|
|
||
| module "gke" { | ||
| source = "./modules/gke" | ||
| module "networking" { |
There was a problem hiding this comment.
Should we add the data "google_client_config" ... (from providers.tf) to main.tf?
There was a problem hiding this comment.
Seems like we always had it there and it was just duplicated in the prociders.tf file as well:
terraform-google-materialize/main.tf
Line 170 in c4eb806
As we discussed a few weeks ago, introducing a new networking module rather than handling all of the network resources within the other modules.
Fixes #16
While working on this I also removed the providers definition from the root module similar to what we did for the AWS module to allow users to handle that configuration on their end. See individual commits for those changes.