gpt4 book ai didi

amazon-web-services - 是否可以从 CloudWatch 为 Lambda 状态函数集创建计划规则

转载 作者:行者123 更新时间:2023-12-04 07:50:17 26 4
gpt4 key购买 nike

我想使用 CloudFormation 按计划(30 分钟)使用 Step Functions 将一堆预先存在的 Lambda 函数创建到状态机中。我已成功为其他方法创建了堆栈。

本质上,我需要有关如何在 CloudFormation 中为 Step Functions 创建预定事件的帮助或指导。这是我一直在尝试的:

"NOTDScheduler": {
"Type": "AWS::Events::Rule",
"Properties": {
"Description": "Schedules a NOTD every 30 minutes",
"ScheduleExpression": "rate(30 minutes)",
"State": "ENABLED",
"Targets": [
{
"Arn": "${statemachineARN}",
"statemachineARN": {
"Fn::GetAtt": [
"NOTDStateMachine",
"Arn"
]
},
"Id": "NOTDScheduleTarget"
}
]
},

但我不断收到诸如

之类的错误

[Error] /Resources/NOTDScheduler/Properties/Targets/0/statemachineARN/Fn::GetAtt: Resource type AWS::StepFunctions::StateMachine does not support attribute {Arn}.

并且不知道为什么 Arn 不是受支持的属性。有解决办法吗?

最佳答案

要获取 AWS::StepFunctions::StateMachine 资源的 ARN,您需要调用 !Ref NOTDStateMachine 而不是 !GetAtt NOTDStateMachine.Arn

在此处检查返回值:http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html

关于amazon-web-services - 是否可以从 CloudWatch 为 Lambda 状态函数集创建计划规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44525535/

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