简体   繁体   中英

How to Pass integer as variable to Wait Type of State in aws-step-function using serverless.io framework and the serverless.yml file

In serverless.yml, I am using AWS step function... and one of the state is Wait where I am trying to use the output from other state... but the generated CFT puts \" around the variable and so the deploy of that state engine is failing. How to handle this? I get below error:

Invalid State Machine Definition: 'SCHEMA_VALIDATION_FAILED: Expected value of type Integer at /States/WaitTill/Seconds

Tried putting a hard coded integer value and it works fine. sls version is 1.38.0

State from serverless.yml file 
            WaitTill:
            Type: Wait
            Seconds: $.Result.seconds_to_wait
            Next: ProcessAhead

Here is the converted CFT json

\"WaitTill\": {\n      \"Type\": \"Wait\",\n      \"Seconds\": \"$.Result.seconds_to_wait\"

To use a variable, you need to use field "SecondsPath" instead of "Seconds". It works the same way as Result vs ResultPath.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM