IRSA works in the blue cluster but the same Deployment in the new green cluster fails with `Not authorized to perform sts:AssumeRoleWithWebIdentity`
IntermediateTroubleshootingCloud identity: IRSA, Workload Identity and CI OIDC
Answer
Likely causes → Each EKS cluster has its own OIDC issuer. The role trusts only the blue cluster's provider, and the green cluster's provider may not even be registered yet.
Diagnose →
for c in blue green; do aws eks describe-cluster --name $c --query cluster.identity.oidc.issuer --output text; done
aws iam get-role --role-name api-prod --query 'Role.AssumeRolePolicyDocument.Statement[].Principal'
Fix → Register the green provider and add a second statement for it to the trust policy (same sub). Remove the blue statement after cutover.
Prevent → Parameterize trust policies with a list of cluster issuers, or move to EKS Pod Identity, where the trust is on pods.eks.amazonaws.com and associations are per cluster.
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