【问题标题】:Is it possible to create a Scheduled Rule from CloudWatch for a Lambda State Function Set是否可以从 CloudWatch 为 Lambda 状态函数集创建计划规则
【发布时间】:2017-11-15 11:17:16
【问题描述】:

我想使用 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"
                }
            ]
        },

但我不断收到诸如

之类的错误

[错误] /Resources/NOTDScheduler/Properties/Targets/0/statemachineARN/Fn::GetAtt:资源类型 AWS::StepFunctions::StateMachine 不支持属性 {Arn}。

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

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation amazon-cloudwatch aws-step-functions


    【解决方案1】:

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

    在此处查看Return Valueshttp://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html

    【讨论】:

      猜你喜欢
      • 2020-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 2021-04-25
      • 2017-11-09
      相关资源
      最近更新 更多