Back to all operators

ForAllValues:StringNotLikeIfExists

ForAllValues:StringNotLikeIfExists

compares a list of strings in a request to a list of strings in your policy. The policy values can include asterisks (*) to match multiple characters and question marks (?) to match a single character. 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:StringNotLikeIfExists 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:StringNotLike instead so your coworkers don't hate you.

ForAllValues:StringNotLikeIfExists in an Allow Statement

Simulate in IAM Simulate
Policy ConditionRequest ContextResult
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys: null✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys:
 - Owner:Legal
 - State:NY
− Not Allowed Statement does not apply
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys:
 - Owner:Legal
 - owner:Legal
− Not Allowed Statement does not apply
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys:
 - owner:Legal
✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys:
 - owner:Legal
 - State:NewYork
✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys:
 - owner:Legal
 - State:NewYork
 - Owner:Legal
− Not Allowed Statement does not apply

ForAllValues:StringNotLikeIfExists in a Deny Statement

Simulate in IAM Simulate
Policy ConditionRequest ContextResult
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys: null✕ Denied
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys:
 - Owner:Legal
 - State:NY
− Not Denied May be allowed by another statement
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys:
 - Owner:Legal
 - owner:Legal
− Not Denied May be allowed by another statement
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys:
 - owner:Legal
✕ Denied
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys:
 - owner:Legal
 - State:NewYork
✕ Denied
"ForAllValues:StringNotLikeIfExists": {
"aws:TagKeys": [
"Owner:*",
"State:??"
]
}
aws:TagKeys:
 - owner:Legal
 - State:NewYork
 - Owner:Legal
− Not Denied May be allowed by another statement