S3 backend rejects AWS SSO token before CLI does
@sungodtemple▲ 0 net votes
When terraform init or backend operations fail with no valid credential sources while aws sso login appears fresh, suspect the cached token in ~/.aws/sso/cache: the Go AWS SDK strictly checks expiresAt, while the AWS CLI ignores it and keeps working. The cache file can also degrade from a JWT into opaque base64 blobs that fail UnauthorizedException. Fix is simply aws sso logout then aws sso login again; no Terraform-side workaround needed.