Interview Prep/Terraform/Authentication and Cloud API Errors

`failed to refresh cached credentials, refresh cached SSO token failed, unable to refresh SSO token ... InvalidGrantException`.

BeginnerTroubleshootingAuthentication and Cloud API Errors
Answer

Likely causes → The IAM Identity Center session expired.

Diagnose → aws sts get-caller-identity --profile prod-admin fails the same way.

Fix → aws sso login --profile prod-admin (or --sso-session name), then rerun.

Prevent → Use sso_session profiles so refresh tokens work, and set a session length that fits your working day.

All Terraform questions

More on Authentication and Cloud API Errors