title: Serverless deploy fails due to state machine definition error
body: <p>I am trying to deploy a simple app using Serverless and can't get the deploy to finish. I am getting the following error:</p>
  
  <pre><code>Serverless Error ---------------------------------------
  
    ✕ State machine "checkAirtableSM" definition is invalid:
    [{"keyword":"additionalProperties","dataPath":".States['CheckAirtable']","schemaPath":"#/additionalProperties","params":{"additionalProperty":"Resource"},"message":"should NOT have additional properties"},{"keyword":"additionalProperties","dataPath":".States['CheckAirtable']","schemaPath":"http://asl-validator.cloud/fail#/additionalProperties","params":{"additionalProperty":"Resource"},"message":"should NOT have additional properties"},{"keyword":"additionalProperties","dataPath":".States['CheckAirtable']","schemaPath":"#/additionalProperties","params":{"additionalProperty":"Resource"},"message":"should NOT have additional properties"},{"keyword":"additionalProperties","dataPath":".States['CheckAirtable']","schemaPath":"http://asl-validator.cloud/pass#/additionalProperties","params":{"additionalProperty":"Resource"},"message":"should NOT have additional properties"},{"keyword":"additionalProperties","dataPath":".States['CheckAirtable']","schemaPath":"http://asl-validator.cloud/succeed#/additionalProperties","params":{"additionalProperty":"Resource"},"message":"should NOT have additional properties"},{"keyword":"pattern","dataPath":".States['CheckAirtable'].Resource","schemaPath":"http://asl-validator.cloud/task#/properties/Resource/oneOf/0/pattern","params":{"pattern":"^arn:aws:([a-z]|-)+:([a-z]|[0-9]|-)*:[0-9]*:([a-z]|-)+:[a-zA-Z0-9-_.]+(:(\\$LATEST|[a-zA-Z0-9-_]+))?$"},"message":"should match pattern \"^arn:aws:([a-z]|-)+:([a-z]|[0-9]|-)*:[0-9]*:([a-z]|-)+:[a-zA-Z0-9-_.]+(:(\\$LATEST|[a-zA-Z0-9-_]+))?$\""},{"keyword":"type","dataPath":".States['CheckAirtable'].Resource","schemaPath":"http://asl-validator.cloud/task#/properties/Resource/oneOf/1/type","params":{"type":"object"},"message":"should be object"},{"keyword":"oneOf","dataPath":".States['CheckAirtable'].Resource","schemaPath":"http://asl-validator.cloud/task#/properties/Resource/oneOf","params":{"passingSchemas":null},"message":"should match exactly one schema in oneOf"},{"keyword":"additionalProperties","dataPath":".States['CheckAirtable']","schemaPath":"http://asl-validator.cloud/wait#/additionalProperties","params":{"additionalProperty":"Resource"},"message":"should NOT have additional properties"},{"keyword":"additionalProperties","dataPath":".States['CheckAirtable']","schemaPath":"#/additionalProperties","params":{"additionalProperty":"Resource"},"message":"should NOT have additional properties"},{"keyword":"oneOf","dataPath":".States['CheckAirtable']","schemaPath":"#/oneOf","params":{"passingSchemas":null},"message":"should match exactly one schema in oneOf"}]
  </code></pre>
  
  <p>The following is my serverless.yml file:</p>
  
  <pre><code># NOTE: update this with your service name
  service: scheduler-api
  
  # Create an optimized package for our functions 
  package:
    individually: true
  
  plugins:
    - serverless-bundle # Package our functions with Webpack
    - serverless-offline
    - serverless-dotenv-plugin # Load .env as environment variables
    - serverless-step-functions
    - serverless-pseudo-parameters
  
  provider:
    name: aws
    runtime: nodejs10.x
    stage: dev
    region: us-east-2
    # To load environment variables externally
    # rename env.example to .env and uncomment
    # the following line. Also, make sure to not
    # commit your .env.
    #
    # These environment variables are made available to our functions
    # under process.env.
    environment:
      airtableBaseId: ${env:AIRTABLE_BASE_ID}
      airtableApiKey: ${env:AIRTABLE_API_KEY}
      STEP_FUNCTION_ARN: "arn:aws:states:#{AWS::Region}:#{AWS::AccountId}:stateMachine:${self:service}-${self:provider.stage}-scheduleTweetSM"
      twitter_consumer_key: ${env:TWITTER_CONSUMER_KEY}
      twitter_consumer_secret: ${env:TWITTER_CONSUMER_SECRET}
      twitter_access_token_key: ${env:TWITTER_ACCESS_TOKEN_KEY}
      twitter_access_token_secret: ${env:TWITTER_ACCESS_TOKEN_SECRET}
  
  functions:
    checkairtable:
      handler: check.main
    pushtweet:
      handler: tweet.main
  
  stepFunctions:
    validate: true
    stateMachines:
      checkAirtableSM:
        name: AirtableChecker
        definition:
          Comment: "Checks for posts that are complete and ready to be scheduled for posting in airtable and schedules them."
          StartAt: CheckAirtable
          States:
            CheckAirtable:
              Type: Task
              Resource: "arn:aws:lambda:#{AWS::Region}:#{AWS::AccountId}:function:${self:service}-${self:provider.stage}-checkairtable"
              End: true
        events:
          - schedule:
              rate: cron(0 0/6 * * ? *)
              enabled: true
      scheduleTweetSM:
        name: TweetScheduler
        definition:
          Comment: "Waits until the post time, then posts the tweet to Twitter."
          StartAt: WaitForPostTime
          States:
            WaitForPostTime:
              Type: Wait
              TimestampePath: $.postTime
              Next: PushPost
            PushPost:
              Type: Task
              Resource: "arn:aws:lambda:#{AWS::Region}:#{AWS::AccountId}:function:${self:service}-${self:provider.stage}-pushtweet"
              End: true
  </code></pre>
  
  <p>The working theory is that somehow serverless-pseudo-parameters isn't working as expected and is malforming the arn of the resource, which is then complaining of the malformation. Is there anyway to check what the <code>serverless deploy</code> command is making for the serverless.yaml after the strings have been replaced by serverless-pseudo-parameters?</p>