Hey guys, not sure if you have tests for it but yo...
# sst
b
Hey guys, not sure if you have tests for it but you can't define a rule for use the
EventBus
construct Using the entirety of the
RuleProps
interface from CDK:
Copy code
new EventBus(this, "scheduler", {
            rules: {
                rule1: {
                    targets: ["path/to/file.handler"],
                    schedule: Schedule.cron({ minute: "1" })
                }
            }
        })
Gives the error:
Copy code
Cannot associate rule with 'eventBus' when using 'schedule'
Might want to look through what's compatible and what's being omitted on
EventBusCdkRuleProps
The error is being thrown by CDK in
aws-events/lib/rule.js
f
Hey @Brinsley, does the
Cron
construct for u?
b
Not tried checking that line by itself but it appears to be the the actual
Rule
construct that's the problem, looking at the source in CDK the error is thrown because bot
eventBus
AND
schedule
are both defined:
Copy code
...
props.eventBus&&props.schedule)throw new Error("Cannot associate rule with 'eventBus' when using 'schedule'");
This isn't an SST "problem" to fix necessarily since the configuration just is allowed by CDK - was more raising it so you guys could potentially self-protect against it with your type definitions 🙂