Interview Prep/DevSecOps/Cloud identity: IRSA, Workload Identity and CI OIDC

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.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Cloud identity: IRSA, Workload Identity and CI OIDC