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 ConditionRequest ContextResult
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys: null✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - Dept
 - SIC
− Not Allowed Statement does not apply
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - DataClass
 - Dept
− Not Allowed Statement does not apply
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - DataClass
✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - DataClass
 - Owner
✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - DataClass
 - Owner
 - Dept
− Not Allowed Statement does not apply

ForAllValues:StringEqualsIfExists in a Deny Statement

Simulate in IAM Simulate
Policy ConditionRequest ContextResult
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys: null✕ Denied
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - Dept
 - SIC
− Not Denied May be allowed by another statement
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - DataClass
 - Dept
− Not Denied May be allowed by another statement
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - DataClass
✕ Denied
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - DataClass
 - Owner
✕ Denied
"ForAllValues:StringEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - DataClass
 - Owner
 - Dept
− Not Denied May be allowed by another statement