terraform-google-modules / terraform-google-kubernetes-engine

Configures opinionated GKE clusters
https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google
Apache License 2.0
1.15k stars 1.17k forks source link

fix: ignore control plane network when private endpoint subnet is set #2122

Closed wyardley closed 2 months ago

wyardley commented 2 months ago

Set master_ipv4_cidr_block to null when private_endpoint_subnetwork is set, as the two conflict with an API level error being thrown: Error: googleapi: Error 400: When masterIpv4Cidr is set, privateEndpointSubnetwork must be unset.

Fixes #2119

This would have the effect of silently ignoring the setting even when master_ipv4_cidr_block is explicitly set. A better fix might be to throw an error, but given that there's a baked in default and that terraform module validation can't look at the values of other variables, I don't think that would be trivial.

apeabody commented 2 months ago

/gcbrun