Cross-account deploy fails with `User: arn:aws:sts::111111111111:assumed-role/ci/... is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::222222222222:role/deploy`
BeginnerTroubleshootingCloud identity: IRSA, Workload Identity and CI OIDC
Answer
Likely causes → A cross-account assume needs both sides. The target role's trust policy must trust the source principal, and the source role must have sts:AssumeRole on the target ARN. One side is missing, or an sts:ExternalId condition is not met.
Diagnose →
aws iam get-role --role-name deploy --query Role.AssumeRolePolicyDocument # run in 222...
aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111111111111:role/ci \
--action-names sts:AssumeRole --resource-arns arn:aws:iam::222222222222:role/deploy
Fix → Trust the specific role ARN (arn:aws:iam::111111111111:role/ci), not the account root. Add the sts:AssumeRole allow on the source side.
Prevent → Use a deploy-role module per target account and test assumption in a pipeline smoke step.
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