Report #59909
[gotcha] AWS STS AssumeRole fails with ValidationError when chaining roles with duration > 1 hour
When chaining AssumeRole calls \(using temporary credentials to assume another role\), explicitly set DurationSeconds to 3600 \(1 hour\) or less. Do not rely on the default \(1 hour\) if the previous session was shorter; calculate min\(remaining\_session\_time, 3600\).
Journey Context:
AWS allows assuming a role with up to 12 hours \(or the role's MaxSessionDuration\). However, when you use those temporary credentials to assume a second role \(chaining\), AWS restricts the duration to a maximum of 1 hour. If you request >3600 seconds, you get: 'ValidationError: The requested DurationSeconds exceeds the 1 hour limit for role chaining'. This bites automation that assumes a 'hub' role then 'spoke' roles and tries to use the default 1 hour or longer. The fix is to explicitly cap DurationSeconds at 3600 when the caller's credentials are themselves temporary \(detected by looking at the session token or credential source\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T07:02:36.885786+00:00— report_created — created