【发布时间】:2022-10-13 12:19:58
【问题描述】:
我正在使用serverless step functions plugin,我需要从环境变量中指定超时。问题是我不知道如何将其转换为数字(Cloudformation 在运行时预期),我没有找到任何辅助函数来执行此操作:
serverless.yml
stepFunctions:
stateMachines:
MyStateMachine:
name: 'MyStateMachine'
definition:
Comment: ''
StartAt: Worker
States:
Worker:
Type: Task
Resource: arn:aws:states:::ecs:runTask.waitForTaskToken
InputPath: $
ResultPath: $
OutputPath: $
TimeoutSeconds: ${env:TIMEOUT_SECONDS} # Need this to be casted to a number
Parameters:
# ...
Catch:
- ErrorEquals: ["States.ALL"]
Next: Failure
Next: Success
Failure:
Type: Fail
Success:
Type: Succeed
【问题讨论】:
标签: amazon-web-services yaml amazon-cloudformation serverless serverless-framework