2

I'm trying to create an AWS EKS private cluster using Terraform with the private subnet in VPC in AWS region us-west-2 region, with default terraform eks module configurations.

When I set the endpoint_private_access=true and endpoint_public_access=false ran the terraform apply command for provisioning the cluster and it fails and throws the error which is in the below error section.

I have followed the steps by deleting the .terraform folder and its contents and re-initiated the modules and applied the terraform plan and terraform apply, but still, it throws the same error.

But, when I set the public and private API endpoint to true, everything works well without any issues. As have recommended in Terraform eks module git issues, I've applied the terraform apply second time but still, I'm seeing the same error data "http" "wait_for_cluster" error

I have waited for 35min to provisioned for coredns, aws-node and kube-proxy, but those are not provisioned

I'm using Terraform:v.1.02 with Terraform eks module 17.1.0 from terraform registry

Error

with module.app_eks.data.http.wait_for_cluster[0], on .terraform\modules\private_eks\data.tf line 89, in data "http" "wait_for_cluster": 89: data "http" "wait_for_cluster" {

I have added variables as wait_for_cluster_timeout = var.wait_for_cluster_timeout and set the timeout to 300 and 3000 also, but I'm seeing the same error

If someone gives any inputs or solutions or recommendations to this, it will help me and others who are facing this issue

KNCK
  • 103
  • 2
  • 12

1 Answers1

2

When you are setting up your EKS Cluster and setting endpoint_private_access = "true" try using public_access_cidrs = ["<your-ip>/32", <or-try 0.0.0.0/0>]

You can also refer to my terraform code which creates the whole EKS Cluster: EKS TERRAFORM

  • I want to restrict the EKS cluster with only the Private endpoint enabled to true, can you tell me how to achieve that – KNCK Jul 21 '21 at 07:00
  • 2 things here: **1.** Private access is enabled here and you only have to allow your IP externally: https://github.com/lovedeepsh/aws_eks_terraform/blob/main/eks/eks_cluster.tf#L8 **2.** If you want to **privately** access the cluster your machine should be under the same VPC Network. So question is do you have any VPN setup in that network? – Lovedeep Sharma Jul 21 '21 at 10:20