Skip to content
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

Expose cluster name_servers as module output #133

Closed
wants to merge 4 commits into from

Conversation

soulshake
Copy link
Contributor

@soulshake soulshake commented Sep 16, 2020

It would be useful to be able to retrieve cluster ingress nameservers programmatically, i.e. in cases where one wants to control the top-level zone while delegating authority to the cluster nameservers managing the base_domain defined in config.auto.tfvars.

Current behavior

Currently, to see the cluster ingress nameservers, one must do something like:

terraform state show module.eks_zero.module.cluster.aws_route53_zone.current[0]

Proposed behavior

The proposed change expresses the nameservers as outputs, allowing one to retrieve them programmatically, e.g. module.eks_zero.default_ingress_nameservers, in order to do things like:

resource "aws_route53_record" "cluster-ns" {
  zone_id         = aws_route53_zone.root.zone_id
  allow_overwrite = true
  name            = var.clusters.eks_zero.apps.base_domain
  type            = "NS"
  ttl             = "60"
  records         = module.eks_zero.default_ingress_nameservers   # <---
}

Or to define one's own Terraform output such as the following:

output "cluster_ns" { 
  value = module.eks_zero.default_ingress_nameservers
}
Outputs:

cluster_ns = [
  "ns-1141.awsdns-14.org",
  "ns-116.awsdns-14.com",
  "ns-1754.awsdns-27.co.uk",
  "ns-544.awsdns-04.net",
]

If this seems like an acceptable change, I can add similar outputs to the gke and azurerm providers.

Thoughts?

@@ -0,0 +1,3 @@
output "default_ingress_nameservers" {
value = module.cluster.default_ingress_nameservers
Copy link

@pijemcolu pijemcolu Sep 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The property module.cluster.default_ingress_nameservers doesn't exist in the repository. Shouldn't the output value rather be exposed through the internal _module to the external facing cluster output all the way to the user / code extending the cluster?

@pst
Copy link
Member

pst commented Apr 16, 2021

Closing due to lack of activity.

@pst pst closed this Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants