https://serverless-stack.com/ logo
#help
Title
# help
s

Sam Hulick

04/08/2022, 7:48 PM
could someone help me understand the new
cdk
property in 1.0? like when defining a new EventBus, there’s
rules.myRule.pattern
and
rules.myRule.cdk.rule.eventPattern
. why are there two ways to define a pattern?
f

Frank

04/10/2022, 9:51 PM
rules.myRule.pattern
is the preferred way.
It was a typo in the doc. Fixed.
That said,
rules.myRule.cdk.rule.eventPattern
will also work if
rules.myRule.pattern
is not passed in.
The design decision was such that, SST will “lift” commonly used props out of the
cdk
field for convenience. But you can always dive into the
cdk
field to turn every single knob.
s

Sam Hulick

04/10/2022, 10:00 PM
Gotcha. Thanks Frank, makes sense!