Class Match
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.events.Match
- All Implemented Interfaces:
IResolvable
,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-25T14:21:15.625Z")
@Stability(Stable)
public class Match
extends software.amazon.jsii.JsiiObject
implements IResolvable
An event pattern matcher.
Example:
Rule rule = Rule.Builder.create(this, "rule") .eventPattern(EventPattern.builder() .detail(Map.of( "object", Map.of( // Matchers may appear at any level "size", Match.greaterThan(1024)), // 'OR' condition "source-storage-class", Match.anyOf(Match.prefix("GLACIER"), Match.exactString("DEEP_ARCHIVE")))) .detailType(Match.equalsIgnoreCase("object created")) // If you prefer, you can use a low level array of strings, as directly consumed by EventBridge .source(List.of("aws.s3")) .region(Match.anythingButPrefix("us-gov")) .build()) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResolvable
IResolvable.Jsii$Default, IResolvable.Jsii$Proxy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMatches an event if any of the provided matchers do.Matches an event if any of the provided matchers does.anythingBut
(@NotNull Object... values) Matches anything except what's provided in the rule.anythingButPrefix
(String prefix) Matches any string that doesn't start with the given prefix.asList()
A representation of this matcher as a list of strings.Matches IPv4 and IPv6 network addresses using the Classless Inter-Domain Routing (CIDR) format.Matches when the field is absent from the JSON of the event.Matches numbers equal to the provided value.equalsIgnoreCase
(String value) Matches a string, regardless of case, in the JSON of the event.exactString
(String value) Matches a string, exactly, in the JSON of the event.exists()
Matches when the field is present in the JSON of the event.The creation stack of this resolvable which will be appended to errors thrown during resolution.greaterThan
(Number value) Matches numbers greater than the provided value.greaterThanOrEqual
(Number value) Matches numbers greater than, or equal to, the provided value.Matches numbers inside a closed numeric interval.ipAddressRange
(String range) Matches IPv4 and IPv6 network addresses using the Classless Inter-Domain Routing (CIDR) format.Matches numbers less than the provided value.lessThanOrEqual
(Number value) Matches numbers less than, or equal to, the provided value.Matches a null value in the JSON of the event.Matches strings with the given prefix in the JSON of the event.resolve
(IResolveContext context) Produce the Token's value at resolution time.Matches strings with the given suffix in the JSON of the event.toString()
Return a string representation of this resolvable object.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.IResolvable
getTypeHint
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Match
protected Match(software.amazon.jsii.JsiiObjectRef objRef) -
Match
protected Match(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
allOf
Matches an event if any of the provided matchers do.Only numeric matchers are accepted.
- Parameters:
matchers
- This parameter is required.
-
anyOf
Matches an event if any of the provided matchers does.- Parameters:
matchers
- This parameter is required.
-
anythingBut
@Stability(Stable) @NotNull public static List<String> anythingBut(@NotNull @NotNull Object... values) Matches anything except what's provided in the rule.The list of provided values must contain only strings or only numbers.
- Parameters:
values
- This parameter is required.
-
anythingButPrefix
Matches any string that doesn't start with the given prefix.- Parameters:
prefix
- This parameter is required.
-
cidr
Matches IPv4 and IPv6 network addresses using the Classless Inter-Domain Routing (CIDR) format.- Parameters:
range
- This parameter is required.
-
doesNotExist
Matches when the field is absent from the JSON of the event. -
equal
Matches numbers equal to the provided value.- Parameters:
value
- This parameter is required.
-
equalsIgnoreCase
Matches a string, regardless of case, in the JSON of the event.- Parameters:
value
- This parameter is required.
-
exactString
Matches a string, exactly, in the JSON of the event.- Parameters:
value
- This parameter is required.
-
exists
Matches when the field is present in the JSON of the event. -
greaterThan
Matches numbers greater than the provided value.- Parameters:
value
- This parameter is required.
-
greaterThanOrEqual
Matches numbers greater than, or equal to, the provided value.- Parameters:
value
- This parameter is required.
-
interval
@Stability(Stable) @NotNull public static List<String> interval(@NotNull Number lower, @NotNull Number upper) Matches numbers inside a closed numeric interval. Equivalent to:.Match.allOf(Match.greaterThanOrEqual(lower), Match.lessThanOrEqual(upper))
- Parameters:
lower
- Lower bound (inclusive). This parameter is required.upper
- Upper bound (inclusive). This parameter is required.
-
ipAddressRange
Matches IPv4 and IPv6 network addresses using the Classless Inter-Domain Routing (CIDR) format.Alias of
cidr()
.- Parameters:
range
- This parameter is required.
-
lessThan
Matches numbers less than the provided value.- Parameters:
value
- This parameter is required.
-
lessThanOrEqual
Matches numbers less than, or equal to, the provided value.- Parameters:
value
- This parameter is required.
-
nullValue
Matches a null value in the JSON of the event. -
prefix
Matches strings with the given prefix in the JSON of the event.- Parameters:
value
- This parameter is required.
-
suffix
Matches strings with the given suffix in the JSON of the event.- Parameters:
value
- This parameter is required.
-
asList
A representation of this matcher as a list of strings. -
resolve
Produce the Token's value at resolution time.- Specified by:
resolve
in interfaceIResolvable
- Parameters:
context
- This parameter is required.
-
toString
Return a string representation of this resolvable object.Returns a reversible string representation.
- Specified by:
toString
in interfaceIResolvable
- Overrides:
toString
in classObject
-
getCreationStack
The creation stack of this resolvable which will be appended to errors thrown during resolution.This may return an array with a single informational element indicating how to get this property populated, if it was skipped for performance reasons.
- Specified by:
getCreationStack
in interfaceIResolvable
-