All Tools View Categories About Contact Privacy

Role Session Name Validator

Check a proposed --role-session-name against AWS's documented length and character-set rules, with a specific pass/fail reason.

Runs entirely in your browser. This is a local check against AWS's documented RoleSessionName rules, not a live call to the STS API — see the FAQ.

About Role Session Name Validator

The --role-session-name value passed to aws sts assume-role (or the equivalent SDK parameter) looks like free text, but AWS enforces a specific length and character-set rule on it - and a value that violates that rule fails the API call with an error that names the parameter but does not always make it obvious which character was the problem, especially in an automated pipeline where the value was constructed dynamically. Role Session Name Validator checks a proposed session name against AWS's documented rule locally and, on failure, states the specific reason: too short, too long, or which exact character(s) are not allowed.

AWS documents RoleSessionName as 2 to 64 characters, restricted to the pattern [\w+=,.@-]+ - word characters (letters, digits, underscore) plus six specific special characters: +, =, ,, ., @, and -. Anything else - spaces, slashes, most punctuation, unicode letters or symbols - is outside the allowed set. This tool implements exactly that documented pattern and, rather than a single pass/fail bit, reports which specific rule was violated and, for a character-set failure, the exact distinct offending characters found in the string, so the fix is obvious instead of requiring a manual re-scan of a 40-character generated string.

Because this check is a local regex against AWS's published documentation rather than a live call to the STS API, this tool says so plainly instead of implying perfect certainty: if AWS's real server-side enforcement ever differs subtly from its own documented pattern, this tool's verdict could in principle disagree with what a real aws sts assume-role call does. Treat it as a fast, honest local sanity check to catch an obviously invalid session name before it reaches AWS - not as a formal guarantee that a "valid" result will always be accepted, or that an "invalid" result would always be rejected.

A handful of sample session names - some valid, some deliberately invalid in different ways (too short, contains a space, contains a slash, too long) - are provided as one-click examples, so you can see each failure mode reported with its specific reason without having to construct bad input yourself.

Features

  • AWS's documented 2-64 character length rule, checked exactly.
  • AWS's documented [\w+=,.@-]+ character-set rule, checked exactly.
  • Specific failure reason - too short, too long, or invalid characters - not just pass/fail.
  • Exact offending characters listed, deduplicated, on a character-set failure.
  • 3-4 valid and invalid sample names, clickable, covering each failure mode.
  • Honest FAQ about this being a documentation-based local check, not a live AWS API call.
  • 100% client-side.

How to Use

  1. Type or paste a proposed role session name, or click a sample.
  2. Click Validate.
  3. Read the verdict - a pass, or a specific reason for failure.
  4. For an invalid-character failure, check the listed offending character(s) and remove or replace them.
  5. Re-validate until it passes, then use the value with --role-session-name.

Examples

Example 1 - valid. deploy-session-01 - all characters are letters, digits, or an allowed special character, and the length is within range.

Example 2 - too short. a - one character, below the 2-character minimum.

Example 3 - invalid character (space). my session name - fails on the space character, which is not in the allowed set; the tool reports the space specifically.

Example 4 - invalid character (slash). role/session#1 - fails on both / and #, both reported.

Example 5 - too long. A 70-character string - exceeds the 64-character maximum.

Benefits

  • Pinpoints the exact problem instead of a generic failure message.
  • Matches AWS's documented rule precisely, stated honestly as a documentation-based check rather than a live API guarantee.
  • Catches obviously invalid values before they reach AWS, especially useful for dynamically-constructed session names in automation.
  • Private - nothing you type leaves your browser.

Frequently Asked Questions

Where do these rules come from?
From AWS's published STS <code>AssumeRole</code> API reference for the <code>RoleSessionName</code> parameter: a length of 2 to 64 characters, and a character pattern of <code>[\w+=,.@-]+</code> - meaning letters, digits, underscore (all covered by <code>\w</code>), plus the literal characters <code>+</code>, <code>=</code>, <code>,</code>, <code>.</code>, <code>@</code>, and <code>-</code>. This tool checks exactly that documented pattern, to the best of our knowledge as of when this tool was built.
Is this guaranteed to match what the real AWS STS API accepts?
We believe this matches AWS's documented pattern, but we are being deliberately honest here rather than overclaiming: this tool is a local regex check against published documentation, not a live call to AWS. If AWS's server-side validation has any subtle difference from its own published pattern, or the documentation changes after this tool was built, this tool's verdict could disagree with a real <code>aws sts assume-role</code> call. If you get an unexpected rejection from AWS despite a "valid" verdict here (or vice versa), trust the real API response and treat this as a fast local sanity check, not a substitute for it.
Why exactly 2-64 characters?
That is the documented minimum and maximum length AWS enforces for this parameter. A session name of length 0 or 1, or longer than 64 characters, is rejected by AWS regardless of what characters it contains.
What does \w mean in the allowed character set?
<code>\w</code> is standard regex shorthand for "word character" - in this context, ASCII letters (a-z, A-Z), digits (0-9), and underscore (_). Combined with the six literal special characters this tool checks for (<code>+ = , . @ -</code>), that is the complete allowed set; anything else, including spaces, slashes, unicode letters/emoji, and most punctuation, is rejected.
Why does the tool tell me exactly which character is invalid?
A generic "invalid characters" message makes you re-scan the whole string by eye. This tool instead pinpoints every distinct disallowed character actually present (deduplicated, so a name with five spaces only lists the space once), so you can fix the specific character rather than guessing.
Where does the role session name actually show up?
It becomes part of the assumed role's session identifier, visible in CloudTrail logs and in the ARN of the temporary session (<code>arn:aws:sts::ACCOUNT:assumed-role/ROLE-NAME/SESSION-NAME</code>) - useful for auditing who or what actually made a given API call through a shared role.
Is anything I type sent anywhere?
No - validation runs entirely in your browser, character by character.