如何避免创建重复的CloudWatch事件规则?
从SNS主题中,我们获得了有关何时即将开始的信息。根据收到的时间,创建了一个CloudWatch规则,该规则将在当时调用lambda函数。
稍后,我们可以收到同一事件的更新时间。因此,我们要么需要更新现有的CloudWatch事件规则的CRON表达式,要么必须删除现有规则并创建一个新规则。
如何实现这一目标?如何防止相同规则的CloudWatch事件规则重复?如何确保事件只有一个规则,并且有更新的时间?
From a SNS topic, we get the information regarding when an event is about to start. Based on the time received, a CloudWatch Rule is created that would invoke a Lambda function at the time.
At a later time, we can receive an updated time for the same event. So, we either need to update the CRON expression of the existing Cloudwatch Event Rule or we have to delete the existing rule and create a new one.
How to achieve this? How to prevent duplication of CloudWatch Event Rule for the same rule? How to ensure that only one rule exists for a event and that has the updated time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如下所述: https://docs.aws.amazon.com/ EventBridge/festment/apireference/api_putrule.html
“如果您要更新现有规则,则该规则将替换为您在此Putrule命令中指定的内容。如果您省略了Putrule中的论点,则这些参数的旧值不保留。相反,它们被零值替换。”
As mentioned here: https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutRule.html
“If you are updating an existing rule, the rule is replaced with what you specify in this PutRule command. If you omit arguments in PutRule, the old values for those arguments are not kept. Instead, they are replaced with null values.”