feat: Add k8s_endpoint_public_access variable for private EKS - #88
Merged
Conversation
anatoly-scherbakov
approved these changes
May 25, 2026
gtoonstra
approved these changes
May 25, 2026
Contributor
|
This PR is included in version 1.15.0 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plumbs
endpoint_public_accesson the upstream EKS module as a configurable variable so a deployment can opt into a fully private EKS API server. Today the value is hardcoded totrue, meaning every dedicated-cloud and SaaS cluster has a publicly resolvable API endpoint (typically firewalled to a small CIDR allowlist).Motivation: an upcoming THR (Texas Health Resources) dedicated-cloud deployment requires no public EKS endpoint at all. Without this change, that requirement can't be met without an out-of-band module fork.
Changes
modules/eks/main.tf—endpoint_public_accessreads fromvar.k8s_endpoint_public_access;endpoint_public_access_cidrsis conditionallynullwhen public access is off (avoids phantom-diff UpdateClusterConfig calls in somehashicorp/awsprovider versions when a non-null cidr list is paired with a disabled public endpoint).modules/eks/variables.tf— declares the newk8s_endpoint_public_access(bool, defaulttrue). Also addsdefault = []to the existingk8s_public_access_cidrsso private-only deployments don't have to pass a meaningless allowlist value; description clarifies that the list is ignored when the public endpoint is disabled.variables.tf(top-level wrapper) — mirrors both variable changes so deployments calling the wrapper module can set them.main.tf(top-level wrapper) — threadsk8s_endpoint_public_accessthrough to the EKS submodule call. Linter realigned adjacent argument names; no semantic change there.Backwards compatibility
Every existing deployment (evri, nocd2, disney, astrazeneca, pure, mede, shutterstock, saas/production, saas/production-dr, saas/staging) passes
k8s_public_access_cidrsexplicitly and does not reference the new variable. They get defaulttruefor the new bool, which preserves today's behavior exactly. The rendered terraform plan for any of them is byte-identical to pre-change. Thedefault = []onk8s_public_access_cidrsis a strict relaxation of a previously-required variable — every previously-valid input is still valid.Operational note for the first private-EKS user
The terraform-aws-datafold module itself does not require EKS API connectivity during apply (no
kubernetesorhelmproviders, no kubectl provisioners — only AWS APIs), so the initialinfra/apply can flipk8s_endpoint_public_access = falsefrom day one without a chicken-and-egg problem.However, downstream consumers (Datafold operator install, ArgoCD bootstrap,
kubectlops) do need EKS API connectivity. The expected bring-up for a private-only customer is:infra/withk8s_endpoint_public_access = falseanddeploy_private_access = true— creates cluster + producer-side NLB + VPC endpoint service, publishes service name to SSM.dc_<customer>.tfin the networking backbone — reads SSM, creates the interface endpoint in the backbone VPC.The
deploy_private_access+ backbone consumer endpoint + VPN-to-PrivateLink path exists in code but has not carried customer EKS traffic in production. First customer should budget integration time for that.Validation
terraform fmt -check -recursive— cleanterraform init -backend=false && terraform validateat module root — passes (only pre-existing warnings in externallambda_datadogmodule)terraform validateagainst an existing deployment (evri) using local-path module override — passes; confirms the module's external contract is unchanged for callers that don't set the new variableTest plan
k8s_endpoint_public_access = false