cloudposse / terraform-aws-eks-cluster

Terraform module for provisioning an EKS cluster
https://cloudposse.com/accelerate
Apache License 2.0
513 stars 354 forks source link

Add `aws_eks_cluster.default[*].kubernetes_network_config[0].service_ipv4_cidr` to output #226

Closed z0rc closed 5 months ago

z0rc commented 6 months ago

Describe the Feature

I need to know what service CIDR was automatically picked up by EKS when creating IPv4 cluster.

Expected Behavior

Module provides output eks_cluster_ipv4_service_cidr, just like eks_cluster_ipv6_service_cidr.

Use Case

IPv4 CIDR is needed for calculating cluster-dns-ip (cidrhost(module.eks.eks_cluster_ipv4_service_cidr, 10)) when overriding it in Bottlerocket config with additional addresses when setting up node-local-dns.

Effectively I need to set cluster-dns-ip to something like 169.254.20.10,172.20.0.10, where first ip is node-local-dns and is static, second is automatically computed based on service cidr.

Describe Ideal Solution

Module provides Service IPv4 CIDR in its output.

Alternatives Considered

Adding data resource aws_eks_cluster to root module to fetch this info outside of module cloudposse/eks-cluster/aws.

Additional Context

No response