-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Create Public Cluster with private_cluster_config
block, even when enable_private_endpoint = enable_private_nodes = false
#2820
Comments
@Jberlinsky Can I ask what your config looks like or what error you are getting exactly? I tried creating a cluster like so, with master_ipv4_cidr_block just not in the config, and it seemed to create fine.
|
I think this issue has to do with limitations in how modules can be configured! Since fields can't be excluded, the only nil-like behaviour we can have pre-0.12 is to set the empty string as the value. Our validation means that we don't allow that- the value has to be a valid CIDR- so it's impossible to conditionally create a private cluster. |
Oh, I see! Alright, I'll go ahead and maybe add a customize diff then. |
@emilymye Sorry for the delay. Do you still need something more specific from me? |
Assigning this issue to myself since I'm also interested in having it fixed, I'll probably end up making the change by |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
Affected Resource(s)
Problem Statement
At present, due to shortcomings in the current version of Terraform and the implementation of
private_cluster_config
in this provider, it is not possible to specify aprivate_cluster_config
block without making the cluster private. This prevents the development of wrapper modules without adding significant complexity to their implementation.This issue was uncovered while developing terraform-google-kubernetes-engine. In building out this module, we wish to allow users to specify whether their cluster should be public or private. However, due to the implementation at the provider level, it is not possible to do so -- since blocks can not be specified to resources in a modular manner, that resource is preordained to be private or not. Although the provider currently allows
private_cluster_config.enable_private_endpoint
andprivate_cluster_config.enable_private_nodes
to both befalse
,private_cluster_config. master_ipv4_cidr_block
is required to be a valid CIDR.Suggested Change(s)
It seems reasonable to allow an empty string (or some other control string) to be passed here, which the backing Golang code would interpret as an instruction to disregard the
master_ipv4_cidr_block
argument when populating thegoogle_container_cluster
resource.The text was updated successfully, but these errors were encountered: