Back to all operators
ForAllValues:StringEqualsIfExists
ForAllValues:StringEqualsIfExists
compares a list of strings in a request to a list of strings in your policy. The comparison is case sensitive.
To match a request, the context key can be absent, but if it is present, all of the strings in the request must match at least one of the strings in your policy.
You can use policy variables in the value of this operator.
Warning
ForAllValues:StringEqualsIfExists is actively confusing. Any operator starting with ForAllValues ignores IfExists — it is not evaluated against the entire array, only against a single value at a time inside the ForAllValues loop. Use ForAllValues:StringEquals instead so your coworkers don't hate you.
ForAllValues:StringEqualsIfExists in an Allow Statement
Simulate in IAM Simulate| Policy Condition | Request Context | Result |
|---|---|---|
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: null | ✓ Allowed Assuming no explicit Deny elsewhere |
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: | − Not Allowed Statement does not apply |
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: | − Not Allowed Statement does not apply |
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: | ✓ Allowed Assuming no explicit Deny elsewhere |
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: | ✓ Allowed Assuming no explicit Deny elsewhere |
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: | − Not Allowed Statement does not apply |
ForAllValues:StringEqualsIfExists in a Deny Statement
Simulate in IAM Simulate| Policy Condition | Request Context | Result |
|---|---|---|
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: null | ✕ Denied |
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: | − Not Denied May be allowed by another statement |
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: | − Not Denied May be allowed by another statement |
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: | ✕ Denied |
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: | ✕ Denied |
"ForAllValues:StringEqualsIfExists": { | aws:TagKeys: | − Not Denied May be allowed by another statement |

