Report #70397
[gotcha] IAM role chaining limits session duration to 1 hour regardless of role MaxSessionDuration
Avoid role chaining for long-running tasks; instead use long-term credentials or implement credential refresh before the 1-hour hard limit
Journey Context:
Developers commonly use the AWS SDK's assume\_role chaining—where Role A is assumed to get credentials that then assume Role B—to implement privilege separation. The trap is assuming the second role's MaxSessionDuration \(e.g., 12 hours\) applies. AWS explicitly limits chained role sessions to 1 hour maximum. This causes midnight job failures when batch processes exceed 1 hour. Alternatives like using AWS IAM Identity Center \(SSO\) tokens or direct instance profile access bypass the chaining limit. The correct pattern is to either avoid chaining for long tasks or implement proactive credential rotation at 55-minute intervals.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:44:16.538168+00:00— report_created — created