ExpiredToken: The security token included in the request is expired
AWSの一時的な認証情報が期限切れの場合に発生するエラー
概要
ExpiredToken: The security token included in the request is expired は、AWSの一時的なセキュリティ認証情報(セッショントークン)が期限切れになった場合に発生するエラーです。
エラーメッセージ
An error occurred (ExpiredToken) when calling the ListBuckets operation: The security token included in the request is expired
ExpiredTokenException: The security token included in the request is expired
原因
- セッショントークンの期限切れ: STS で取得したトークンが期限切れ
- AssumeRole の有効期限: ロールの一時認証情報が期限切れ
- MFA セッションの期限切れ: MFA で取得したセッションが期限切れ
- Lambda の認証情報キャッシュ: 古い認証情報がキャッシュされている
- 長時間実行タスク: バッチ処理中に認証情報が期限切れ
解決策
1. 新しいセッショントークンを取得
| |
2. AssumeRole で新しい認証情報を取得
| |
3. MFA でセッショントークンを取得
| |
4. プロファイルで自動更新を設定
| |
| |
5. SDK での自動更新
| |
6. Lambda での対処
| |
7. 環境変数のクリア
| |
8. GitHub Actions での対処
| |
9. 有効期限の延長
| |
デバッグのコツ
認証情報の有効期限を確認
| |
関連エラー
AWS の他のエラー
AccessDeniedException: User is not authorized
ECS CannotPullContainerError
AccessDenied: User is not authorized to perform sts:AssumeRole
IncompleteSignature: The request signature we calculated does not match
MissingAuthenticationToken: Missing Authentication Token
SignatureDoesNotMatch: The request signature we calculated does not match
この記事は役に立ちましたか?