Back to all operators

ForAnyValue:BinaryEqualsIfExists

ForAnyValue:BinaryEqualsIfExists

compares a list of binary values in a request to a list of base64-encoded string representations in your policy. There are no known binary context keys, but this is put here for completeness.

To match a request, the context key must exist in the request and at least one binary value in the request must match one of the base64-encoded string representations in your policy.

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

Warning

As far as we know, ForAnyValue:BinaryEqualsIfExists can never be used — no context keys exist that are an array of base64-encoded string representations. It's documented here as an example of how it would work, but if you see it in the wild, it's probably a mistake.

ForAnyValue:BinaryEqualsIfExists in an Allow Statement

Policy ConditionRequest ContextResult
"ForAnyValue:BinaryEqualsIfExists": {
"aws:BinaryKey": [
"YmFzZUBjbG91ZGNvcGlsb3QuaW8=",
"NjRAY2xvdWRjb3BpbG90Lmlv"
]
}
aws:BinaryKey: null− Not Allowed Statement does not apply
"ForAnyValue:BinaryEqualsIfExists": {
"aws:BinaryKey": [
"YmFzZUBjbG91ZGNvcGlsb3QuaW8=",
"NjRAY2xvdWRjb3BpbG90Lmlv"
]
}
aws:BinaryKey:
 - c2lsbGluZXNz
 - c2hlbmFuaWdhbnM=
− Not Allowed Statement does not apply
"ForAnyValue:BinaryEqualsIfExists": {
"aws:BinaryKey": [
"YmFzZUBjbG91ZGNvcGlsb3QuaW8=",
"NjRAY2xvdWRjb3BpbG90Lmlv"
]
}
aws:BinaryKey:
 - YmFzZUBjbG91ZGNvcGlsb3QuaW8=
 - c2lsbGluZXNz
✓ Allowed Assuming no explicit Deny elsewhere
"ForAnyValue:BinaryEqualsIfExists": {
"aws:BinaryKey": [
"YmFzZUBjbG91ZGNvcGlsb3QuaW8=",
"NjRAY2xvdWRjb3BpbG90Lmlv"
]
}
aws:BinaryKey:
 - YmFzZUBjbG91ZGNvcGlsb3QuaW8=
 - NjRAY2xvdWRjb3BpbG90Lmlv
✓ Allowed Assuming no explicit Deny elsewhere
"ForAnyValue:BinaryEqualsIfExists": {
"aws:BinaryKey": [
"YmFzZUBjbG91ZGNvcGlsb3QuaW8=",
"NjRAY2xvdWRjb3BpbG90Lmlv"
]
}
aws:BinaryKey:
 - YmFzZUBjbG91ZGNvcGlsb3QuaW8=
 - NjRAY2xvdWRjb3BpbG90Lmlv
 - c2lsbGluZXNz
✓ Allowed Assuming no explicit Deny elsewhere

ForAnyValue:BinaryEqualsIfExists in a Deny Statement

Policy ConditionRequest ContextResult
"ForAnyValue:BinaryEqualsIfExists": {
"aws:BinaryKey": [
"YmFzZUBjbG91ZGNvcGlsb3QuaW8=",
"NjRAY2xvdWRjb3BpbG90Lmlv"
]
}
aws:BinaryKey: null− Not Denied May be allowed by another statement
"ForAnyValue:BinaryEqualsIfExists": {
"aws:BinaryKey": [
"YmFzZUBjbG91ZGNvcGlsb3QuaW8=",
"NjRAY2xvdWRjb3BpbG90Lmlv"
]
}
aws:BinaryKey:
 - c2lsbGluZXNz
 - c2hlbmFuaWdhbnM=
− Not Denied May be allowed by another statement
"ForAnyValue:BinaryEqualsIfExists": {
"aws:BinaryKey": [
"YmFzZUBjbG91ZGNvcGlsb3QuaW8=",
"NjRAY2xvdWRjb3BpbG90Lmlv"
]
}
aws:BinaryKey:
 - YmFzZUBjbG91ZGNvcGlsb3QuaW8=
 - c2lsbGluZXNz
✕ Denied
"ForAnyValue:BinaryEqualsIfExists": {
"aws:BinaryKey": [
"YmFzZUBjbG91ZGNvcGlsb3QuaW8=",
"NjRAY2xvdWRjb3BpbG90Lmlv"
]
}
aws:BinaryKey:
 - YmFzZUBjbG91ZGNvcGlsb3QuaW8=
 - NjRAY2xvdWRjb3BpbG90Lmlv
✕ Denied
"ForAnyValue:BinaryEqualsIfExists": {
"aws:BinaryKey": [
"YmFzZUBjbG91ZGNvcGlsb3QuaW8=",
"NjRAY2xvdWRjb3BpbG90Lmlv"
]
}
aws:BinaryKey:
 - YmFzZUBjbG91ZGNvcGlsb3QuaW8=
 - NjRAY2xvdWRjb3BpbG90Lmlv
 - c2lsbGluZXNz
✕ Denied