Value of property Variables must be an object with String (or simple type) properties

Hi

My deploy is failing only on the lambda functions with following error.

Value of property Variables must be an object with String (or simple type) properties

I have no idea, I previous deployed a project with a similar yml and it worked. No problems at all. I am on this past 3 hours. Very frustrating.

service: rhs-biff-restapi

plugins:
  # - serverless-vpc-discovery
  # - serverless-domain-manager
  - serverless-aws-documentation
  - serverless-kms-secrets
  - serverless-jest-plugin
  #- dynalite
  - serverless-webpack
  # - serverless-dynamodb-local
  - serverless-offline
  - serverless-plugin-aws-alerts
  - serverless-plugin-deploy-environment

custom:
  stage: ${self:deployEnvironment.STAGE}
  vpc_env: ${self:deployEnvironment.VPC_ENV}
  prefix: ${self:deployEnvironment.STAGE}-${self:deployEnvironment.SERVICE}


  webpack: webpack.config.js
  webpackIncludeModules: true
  defaults:
     log_level: INFO
     stage: dev
  deploy:
    variables: ${file(config/variables.yml)}
    environments: ${file(config/deploy.yml)}
  notifications:
    - protocol: https
      endpoint: https://events.pagerduty.com/exampleIntegration
  alerts:
      stages:
        - production
        - staging
      topics:
        ok:
          topic: ${self:provider.stage}-${self:service}-alerts-ok
          notifications: ${self:custom.notifications}
        alarm:
          topic: ${self:provider.stage}-${self:service}-alerts-alarm
          notifications: ${self:custom.notifications}
        insufficientData: ${self:provider.stage}-${self:service}-alerts-insufficientData
      definitions:
        functionDuration:
          evaluationPeriods: 5
          threshold: 1000
        functionErrors:
          evaluationPeriods: 2
      global:
        - functionThrottles
        - functionErrors
      function:
        - functionDuration

  serverless-jest-plugin:
    functionTemplate: config/templates/function-template.ejs
    testTemplate: config/templates/test-template.ejs



  dynamodb:
    start:
      port: 8000
      inMemory: true
      migrate: true
      seed: true

  documentation:
    api:
      info:
        ${file(docs/info.yml)}
    tags:
      - name: MyTag
        description: This is my tag
    resources:
      - path: '/health'
        description: 'Endpoint to see if the serverless app is working'
      - path: '/hello'
        description: 'Joyful greeting by your Serverless Application'
    models:
      ${file(docs/models.yml)}

provider:
  name: aws
  runtime: nodejs6.10
  cfLogs: true
  stage: ${opt:stage, self:custom.defaults.stage}
  region: eu-west-1
  profile: ${self:deployEnvironment.PROFILE}

  environment:
    # MY_KMS_SECRET: ${self:custom.kmsSecrets.secrets.foo}
    SERVERLESS_STAGE: ${opt:stage, self:provider.stage}
    SERVERLESS_REGION: ${opt:region, self:provider.region}
    SERVERLESS_PROJECT: ${self:service}
    DYNAMODB_TABLE: ${self:service}-${opt:stage, self:provider.stage}

  iamRoleStatements:
  - Effect: Allow
    Action:
      - dynamodb:*
      - s3:*
    Resource: "*"

  stackTags:
      Team: ${self:deployEnvironment.TEAM}


functions:
  health:
    handler: src/health.health
    events:
      - http:
          method: get
          path: health
          cors: true

  hello:
    handler: handler.hello
    events:
      - http:
          method: get
          path: hello
          cors: true

  error400:
    handler: handler.error400
    events:
      - http:
          method: get
          path: error
          cors: true
  auth:
      handler: handler.auth
  create:
      handler: handler.create
      events:
        - http:
            method: post
            path: api/private/create
            cors: true

  update:
      handler: handler.update
      events:
        - http:
            method: post
            path: api/private/update
            authorizer: auth
            cors:
              origins:
                - '*'
              headers:
                - Content-Type
                - X-Amz-Date
                - Authorization
                - X-Api-Key
                - X-Amz-Security-Token
  delete:
      handler: handler.del
      events:
        - http:
            method: post
            path: api/private/delete
            cors: true
  read:
      handler: handler.read
      events:
        - http:
            method: get
            path: api/public/item
            cors: true
  list:
        handler: handler.list
        events:
          - http:
              method: get
              path: api/public
              cors: true
  test:
      handler: handler.test
      events:
        - http:
            method: get
            path: api/public/test
            cors: true


resources:
  Resources:
    ContentDynamoDbTable:
      Type: AWS::DynamoDB::Table
      Properties:
        TableName: ${self:provider.environment.DYNAMODB_TABLE}
        AttributeDefinitions:
          - AttributeName: Content
            AttributeType: S
          - AttributeName: Id
            AttributeType: S
          - AttributeName: CreatedAt
            AttributeType: N
        KeySchema:
          - AttributeName: Content
            KeyType: HASH
          - AttributeName: Id
            KeyType: RANGE
        ProvisionedThroughput:
            ReadCapacityUnits: 1
            WriteCapacityUnits: 1
        GlobalSecondaryIndexes:
           - IndexName: Contentbydate
             KeySchema:
               - AttributeName: Content
                 KeyType: HASH
               - AttributeName: CreatedAt
                 KeyType: RANGE
             Projection:
                 NonKeyAttributes:
                   - Id
                   - Name
                   - Slug
                   - Featured
                   - Weight
                 ProjectionType: INCLUDE
             ProvisionedThroughput:
                 ReadCapacityUnits: 1
                 WriteCapacityUnits: 1

run sls print to see if your variable are resolving correctly

Sounds like one of your variables can’t resolve a value