A 2-hour Terraform apply from GitHub Actions dies midway with `ExpiredToken: The security token included in the request is expired`
IntermediateTroubleshootingCloud identity: IRSA, Workload Identity and CI OIDC
Answer
Likely causes → configure-aws-credentials defaults to a 1-hour session. If the job chains into another role, role chaining is hard-capped at 1 hour regardless of settings.
Diagnose →
aws iam get-role --role-name gha-deploy --query Role.MaxSessionDuration
Check whether the Terraform provider uses assume_role, which is chaining.
Fix → Raise the role's MaxSessionDuration (up to 43200), set role-duration-seconds: 10800 in the action, and assume the target role directly from OIDC instead of chaining.
Prevent → Split huge applies into smaller state files. Long-running applies are a reliability risk on their own.
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