【发布时间】:2019-01-18 12:07:17
【问题描述】:
我在 cloudformation 中有一个阶梯函数。 cloudformation 堆栈还创建了 Lambda,我将在 step 函数中将其用作资源。我有类似的东西
TestLambda:
Type: "AWS::Lambda::Function"
Properties:
Handler: "test_lambda.lambda_handler"
Role: "arn:aws:iam::1234342334:role/Lambda"
Code:
ZipFile: !Sub |
from __future__ import print_function
import boto3
def lambda_handler(event, context):
print(event)
Runtime: "python2.7"
....
TestStateMachine:
Type: AWS::StepFunctions::StateMachine
Properties:
StateMachineName: "Test"
DefinitionString: |-
{
"StartAt": "State1",
"States": {
"State1" : {
"Type" : "Task",
"Resource" : "${!GetAtt TestLambda.Arn}",
"Next": "State2?"
},
...
...
全部在一个 cloudformation 模板中。
"SCHEMA_VALIDATION_FAILED: Value is not a valid resource ARN"
我也试过 !GetAtt TestLambda.Arn,但没用。我想要在单个 cloudformation 模板中创建的 lambda 和 stepfunction。如果有更好、更清洁的方法,请告诉我。
谢谢
【问题讨论】:
标签: amazon-web-services amazon-cloudformation aws-step-functions