【发布时间】:2019-12-12 12:03:57
【问题描述】:
我正在创建 StepFunctions,它引用在单独的 cloudformation 堆栈中创建的 Lambda 函数。 我将 Lambda arn 导出到 CloudFormation 导出。 我想通过导入导出的值来实现从 StepFunctions 引用该 Lambda 函数。
这是我的 cloudformation sn-p。
StepFunction:
Type: 'AWS::StepFunctions::StateMachine'
Properties:
RoleArn: !GetAtt IamRole.Arn
DefinitionString:
Fn::Sub:
- |-
{
"StartAt": "MessageGenerator",
"States": {
"MessageGenerator": {
"Comment": "generate queue message.",
"Type": "Task",
"Resource": "${LambdaMessageGenerator}",
"ResultPath": "$",
"OutputPath": "$",
"Next": "WaitSeconds"
},
...
}
}
- LambdaMessageGenerator:
Fn::ImportValue: some-export-name
我按照下面的答案做了这个。 Cloudformation - Unable to Import resource
但是,aws cloudformation deploy 命令失败,我收到以下错误。
Invalid State Machine Definition: 'SCHEMA_VALIDATION_FAILED: Value is not a valid resource ARN at /States/MessageGenerator/Resource' (Service: AWSStepFunctions; Status Code: 400; Error Code: InvalidDefinition; Request ID: 01713d53-4605-11e9-9cf3-c15ff9ce09ae)
有人可以帮帮我吗?
【问题讨论】:
-
能否分享一下您的导出配置?
-
您是否尝试过删除 Sub 并对 Lambda ARN 进行硬编码,以确保它与您的 DefinitionString 中的任何其他内容都不相关?
-
解决方案好吗?我什至坚持这一点
标签: aws-lambda amazon-cloudformation aws-step-functions