AWS CDK中Eventbridge Rule同时配置schedule与eventPattern的控制台兼容性问题
AWS CDK(TypeScript)中EventBridge Rule同时配置Schedule与EventPattern的兼容性疑问
我对AWS CDK(TypeScript)里EventBridge Rule同时使用schedule和eventPattern的兼容性及限制不太明确:
- 曾看到有观点认为这两个属性互斥,属于反模式
- 但我部署了同时包含两者的规则,代码如下:
const eventRule = new eventCDK.Rule(this, "scheduledEventID", { eventPattern: { detail: { "neatProperty": "myEventProp" } }, schedule: eventCDK.Schedule.cron({ minute: "30", hour: "*", weekDay: "1-7", month: "*" }) })
- 部署没有报错,但在AWS控制台选中该规则时,收到提示:
Rule scheduledEventID has both event pattern and schedule configured, which is not compatible with Console currently. If you update this rule from Console, only one of them can be kept, do you still want to continue?
- 另外,CDK的
RuleProps文档明确说明:
You must specify this property, the eventPattern property, or both.
想请教:这种情况是否属于异常?我是否应该避免在CDK中同时指定这两个属性?还是我遗漏了文档中关于二者兼容性的相关定义?
内容的提问来源于stack exchange,提问作者TLeitzbach
相关产品推荐
相关产品推荐

