Skip to content
IAM Policy Generator

IfExists operator

An IfExists operator is a condition operator with the suffix IfExists, such as StringEqualsIfExists. It tests the condition only when the key is present in the request and returns true when the key is missing. Without it, a missing key makes the condition false, except for negated operators, which return true.

All terms ยท Open the workbench

An example, sourced

AWS shows a condition that joins IpAddressIfExists on aws:SourceIp and StringEqualsIfExists on aws:SourceVpc: if either or both keys are not in the request context, the condition still returns true.

Why it matters here

IfExists changes how a policy fails. In a Deny statement it can make a restriction apply to requests that lack the key; in an Allow statement it can widen access.

Sources

  1. https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html, read 16 Nov 2026

Last reviewed 16 Nov 2026.