gpt4 book ai didi

What is rule position of an event rule in Eventbridge documentation of Serverless(事件规则在无服务器的EventBridge文档中的规则位置是什么)

转载 作者:bug小助手 更新时间:2023-10-25 10:59:24 26 4
gpt4 key购买 nike



In Eventbridge documentation of Serverless (https://www.serverless.com/framework/docs/providers/aws/events/event-bridge), there is mention of rule position in event rule default naming convention as follows:

在无服务器(https://www.serverless.com/framework/docs/providers/aws/events/event-bridge),的EventBridge文档中提到事件规则默认命名约定中的规则位置,如下所示:



eventBridge events by default are named with the lambda function's
name with a suffix for the rule position.



I want to know what is meant by this "rule position" as I could not find any AWS documentation regarding this

我想知道这个规则位置是什么意思,因为我找不到任何与此相关的AWS文档


更多回答
优秀答案推荐

The "rule position" refers to the position of the rule in the events property of the Lambda function. Let's say you have the following serverless.yml (is not complete, just the relevant parts):

“规则位置”指的是规则在Lambda函数的Events属性中的位置。假设您有以下serverless.yml(不是完整的,只是相关的部分):


service: my-eventbridge-service

functions:
myFunction:
handler: index.handler
events:
- eventBridge:
schedule: cron(0 10 * * ? *)
input:
key1: value1
- eventBridge:
schedule: cron(0 12 * * ? *)
input:
key1: value2

The the EventBridge rules created would be named my-eventbridge-service-dev-myFunction-rule-1 and my-eventbridge-service-dev-myFunction-rule-2.

创建的EventBridge规则将命名为my-ventbridge-service-dev-myFunction-Rule-1和my-ventbridge-service-dev-myFunction-rul2。


You can set the name property to override this behavior.

您可以设置Name属性来重写此行为。


更多回答

Thank you so much Andres for such a nice explanation. I have a follow-up question. If the events array in serverless.yml of your example is something like: events: - sqs: arn: Fn::GetAtt: - AuthQ - Arn batchSize: 1 - eventBridge: schedule: rate(27 minutes) then, whether the rule so created for eventbridge would be like: my-eventbridge-service-dev-myFunction-rule-2 ?

非常感谢安德烈斯如此精彩的解释。我有一个跟进的问题。如果您示例的serverless.yml中的事件数组类似于:Events:-SQS:ARN:fn::GetAtt:-AuthQ-Arn BatchSize:1-EventBridge:Schedule:Rate(27分钟),那么为EventBridge创建的规则是否将类似于:my-eventbridge-service-dev-myFunction-Rule-2?

Yes, indeed, that's correct. I suggest that you use a meaningful name for your rules whenever possible.

是的,的确,没错。我建议您尽可能为规则使用有意义的名称。

Ok Andres, got it. Makes sense to me. Thank you so much for your help once again.

好的,安德烈斯,知道了。对我来说是有道理的。再次感谢您的帮助。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com