InvalidDefinition when passing in an integer variable to a step function


#1

I’m defining a waiting type step function that takes a variable as its timeout setting, like so:

       WaitForReview:
            Type: Task
            TimeoutSeconds: $.submission.duration
            Resource: 'arn:aws:states:#{AWS::Region}:#{AWS::AccountId}:activity:${self:service}-${opt:stage}-activity_waitForReview'
            Next: HowToProceed
            ResultPath: '$.submission'
            Catch:
              - ErrorEquals:
                  - States.Timeout
                ResultPath: '$.error'
                Next: CreditArtistAccount

The one that matters here is $.submission.duration. It’s supposed to be an integer, but when I try to deploy my stack I get the follow error:

Invalid State Machine Definition: 'SCHEMA_VALIDATION_FAILED: Expected value of type Integer at /States/WaitForReview/TimeoutSeconds' (Service: AWSStepFunctions; Status Code: 400; Error Code: InvalidDefinition; Request ID: bb1a13c2-12cb-11e9-b1f0-4f37f70268ef)

Does anyone know how I can grab a variable from the stack and pass it in to the step function and have it be an integer when I do so?