Skip to content

Expose the private_cluster_config attributes as outputs #2533

@imnotyourbrobro

Description

@imnotyourbrobro

TL;DR

For the private-cluster module, it would be nice to have the private_cluster_config exposed as an output so we can derive the private_endpoint IP address. As of now, only the endpoint attribute is exposed as an output.

Terraform Resources

This is the module in question: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/main/modules/private-cluster

Outputs are defined here: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/main/modules/private-cluster/outputs.tf

Detailed design

These could be used:


output "private_cluster_config" {
  description = "Private cluster config"
  value       = google_container_cluster.primary.private_cluster_config
}

Additional information

Someone had recommended a workaround in #502 (comment) with a data source. This can be done that way, but it'd be much nicer if the module exposed it as-is so that this data source doesn't need to be used for inferring the private_endpoint

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions