在测试时,我收到以下消息:
Serverless Warning --------------------------------------
A valid service attribute to satisfy the declaration
'self:resources.Outputs.StateMachine.Value' could not be found.
serverless.yml 的摘录
name: aws
runtime: nodejs12.x
stage: ${opt:stage, 'dev'}
region: us-east-1
lambdaHashingVersion: 20201221
versionFunctions: false
environment:
statemachine_arn: ${self:resources.Outputs.StateMachine.Value}
状态函数
stepFunctions:
stateMachines:
updateMetric:
name: updateMetric
definition:
Comment: "A state machine to update data"
StartAt: getMetric
........
........
输出
resources:
- ${file(./resources/dynamodb-table.yml)}
- Outputs:
StateMachine:
Value:
Ref: UpdateMetric
我正在尝试传递状态机的 ARN,以便我可以从 lamda 函数启动 stateMachine。
看来我在输出部分的参考不起作用,或者我在这里没有正确调用它:
environment:
statemachine_arn: ${self:resources.Outputs.StateMachine.Value}