Pods in a private EKS cluster hang and then fail with `dial tcp 52.94.x.x:443: i/o timeout` when the SDK calls STS
AdvancedTroubleshootingCloud identity: IRSA, Workload Identity and CI OIDC
Answer
Likely causes → The nodes have no NAT route, and there is no STS VPC endpoint, or the SDK targets the global endpoint sts.amazonaws.com, which the regional interface endpoint does not serve.
Diagnose →
kubectl exec deploy/api -- env | grep AWS_STS_REGIONAL_ENDPOINTS
aws ec2 describe-vpc-endpoints --filters Name=service-name,Values=com.amazonaws.ap-south-1.sts
kubectl exec deploy/api -- nslookup sts.ap-south-1.amazonaws.com
Fix → Create an interface endpoint for com.amazonaws.<region>.sts with private DNS enabled, and set AWS_STS_REGIONAL_ENDPOINTS=regional (the IRSA webhook can inject this; current SDKs default to regional). Add endpoints for every other AWS API the app uses (ECR, S3 gateway, Secrets Manager, KMS).
Prevent → Keep a checklist of required VPC endpoints for private clusters and test with a pod that calls each service.
More on Cloud identity: IRSA, Workload Identity and CI OIDC
A pod configured for IRSA runs `aws sts get-caller-identity` and gets the node role (`eks-node-group-role`) instead of its own roleBeginner`An error occurred (AccessDenied) when calling the AssumeRoleWithWebIdentity operation: Not authorized to perform sts:AssumeRoleWithWebIdentity` from an IRSA podIntermediate`InvalidIdentityToken: No OpenIDConnect provider found in your account for https://oidc.eks.ap-south-1.amazonaws.com/id/ABC123`BeginnerIRSA env vars are present in the pod, but one legacy service still uses the node roleIntermediatePods without IRSA can still call AWS with the node's permissions through `169.254.169.254`IntermediateWith EKS Pod Identity, the pod gets `Unable to locate credentials` even though a pod identity association existsIntermediate