serverless-step-functions icon indicating copy to clipboard operation
serverless-step-functions copied to clipboard

I want to specify the waiting time by parameter.

Open DogFortune opened this issue 1 year ago • 0 comments

This is a Question

Description

I want to adjust the waiting time of a state machine with a parameter, but I am having trouble with a validation error. A simple structure of a state machine is described here for reference.

name: sample-statemachine
definition:
  StartAt: wait
  States:
    wait:
      Type: Wait
      Seconds: ${param:intervalSeconds}
      Next: status_ok
    status_ok:
      Type: Pass
      End: true

The deployment commands are as follows

npx sls deploy --verbose \
--stage dev \
--param="intervalSeconds=60"

command, I get an error.

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

When the "print" command is executed, it is indeed a string where an integer should be.

    sample:
      name: sample-statemachine
      definition:
        StartAt: wait
        States:
          wait:
            Type: Wait
            Seconds: '60'  # not integer
            Next: status_ok
          status_ok:
            Type: Pass
            End: true

It would be very helpful if you could tell me if there is a way to make the command successful.

Additional Data

Serverless Framework Core Version you're using: serverless v3.38.0

The Plugin Version you're using:

  • serverless-step-functions v3.19.0
  • serverless-prune-plugin v2.0.2
  • serverless-python-requirements v6.0.1
  • serverless-better-credentials v2.0.0

Operating System:

  • macOS Monterey v12.6.8
  • Node.js v20.11.0
  • npm v10.4.0

DogFortune avatar Feb 15 '24 00:02 DogFortune