Back to all operators

ForAllValues:BoolIfExists

ForAllValues:BoolIfExists

compares a list of booleans in a request to a boolean in your policy.

To match a request, the context key can be absent, but if it is present, all of the booleans in the request must match the boolean in your policy.

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

Warning

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

ForAllValues:BoolIfExists in an Allow Statement

Policy ConditionRequest ContextResult
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired: null✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired:
 - false
 - false
− Not Allowed Statement does not apply
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired:
 - true
 - false
− Not Allowed Statement does not apply
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired:
 - true
✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired:
 - true
 - true
✓ Allowed Assuming no explicit Deny elsewhere
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired:
 - true
 - true
 - false
− Not Allowed Statement does not apply

ForAllValues:BoolIfExists in a Deny Statement

Policy ConditionRequest ContextResult
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired: null✕ Denied
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired:
 - false
 - false
− Not Denied May be allowed by another statement
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired:
 - true
 - false
− Not Denied May be allowed by another statement
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired:
 - true
✕ Denied
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired:
 - true
 - true
✕ Denied
"ForAllValues:BoolIfExists": {
"apigateway:Resource/ApiKeyRequired": "true"
}
apigateway:Resource/ApiKeyRequired:
 - true
 - true
 - false
− Not Denied May be allowed by another statement