Policy variable
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
A policy variable is a placeholder, such as ${aws:username}, that IAM replaces with a value from the request context when it evaluates a policy. It lets one policy cover many users, for example by giving each user a folder named after them. If a variable cannot be resolved, the statement may become invalid.
All terms ยท Open the workbench
An example, sourced
AWS says policy variables serve as placeholders when you do not know the exact value of a resource or condition key at the time you write the policy, and suggests the IfExists operator to keep unresolved variables from invalidating a statement.
Why it matters here
A statement with variables describes a pattern, not a fixed grant. The workbench reads the text and does not resolve variables.
Related pages
Sources
- https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html, read 16 Nov 2026
Last reviewed 16 Nov 2026.