# 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.

## 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

- [Set operator: meaning and an example](/glossary/set-operator/)
- [IfExists operator: meaning and an example](/glossary/ifexists-operator/)
- [Service last accessed information: meaning and an example](/glossary/service-last-accessed-information/)
- [All of them](/glossary/)

## Sources

- https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://iampolicygenerator.com/glossary/policy-variable/

This site is not affiliated with Amazon Web Services. AWS service and product names are used only to describe AWS services.
