Report #69562
[gotcha] STS AssumeRole session duration capped by parent role remaining time when chaining
When assuming Role B from Role A, the max session duration is the lesser of Role B's max session duration and the remaining time on Role A's current session; request the maximum duration \(up to the role's limit\) when assuming the first role, or avoid chaining for long-running tasks.
Journey Context:
Engineers automating cross-account access often assume a hub role \(Role A\) then immediately assume a spoke role \(Role B\), expecting to get Role B's full 12-hour limit. However, STS subtracts the elapsed time of the parent session. If Role A was assumed with default 1 hour, Role B can only get 1 hour minus elapsed time. This breaks long-running ETL or backup jobs. The fix is to request the maximum duration \(up to the role's MaxSessionDuration\) when assuming the first role, or use a different mechanism like ECS task roles or instance profiles that don't chain. Alternatives like using AWS SSO tokens also have different duration constraints.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:14:40.427312+00:00— report_created — created