Report #35814
[gotcha] AWS STS AssumeRole fails with ValidationError due to RoleSessionName length or characters
Ensure RoleSessionName is <= 64 characters and matches regex \`\[\\w\+=,.@-\]\*\`; truncate or hash generated session names \(e.g., from GitHub Actions \`$\{\{ github.run\_id \}\}\`\) before calling AssumeRole.
Journey Context:
Automation pipelines often generate RoleSessionName from job IDs, commit SHAs, or timestamps, easily exceeding 64 chars or containing invalid characters like colons or slashes. The error '1 validation error detected: Value at 'roleSessionName' failed to satisfy constraint' is cryptic. Engineers waste hours checking trust policies when it's just the session name format. This limit is hardcoded in STS and cannot be increased.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:35:12.543959+00:00— report_created — created