Back to all operators

ForAllValues:StringNotEqualsIfExists

ForAllValues:StringNotEqualsIfExists

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, none of the strings in the request can match any string strings in your policy.

You can use policy variables in the value of this operator.

Warning

ForAllValues:StringNotEqualsIfExists 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:StringNotEquals instead so your coworkers don't hate you.

ForAllValues:StringNotEqualsIfExists in an Allow Statement

Simulate in IAM Simulate
Policy ConditionRequest ContextResult
"ForAllValues:StringNotEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys: null✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:StringNotEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - DataClass
 - Owner
− Not Allowed Statement does not apply
"ForAllValues:StringNotEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - DataClass
 - Dept
− Not Allowed Statement does not apply
"ForAllValues:StringNotEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - Dept
✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:StringNotEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - Dept
 - SIC
✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:StringNotEqualsIfExists": {
"aws:TagKeys": [
"DataClass",
"Owner"
]
}
aws:TagKeys:
 - Dept
 - SIC
 - DataClass
− Not Allowed Statement does not apply

ForAllValues:StringNotEqualsIfExists in a Deny Statement

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