Deployment error

Tried to run serverless deploy but getting this error:

Serverless Error ---------------------------------------

Environment variable iamRoleStatements must contain string

Relevant part in my yaml looks like this:

# 'iamRoleStatements' defines the permission policy for the Lambda function.
# In this case Lambda functions are granted with permissions to access DynamoDB.
iamRoleStatements:
  - Effect: Allow
    Action:
      - dynamodb:DescribeTable
      - dynamodb:Query
      - dynamodb:Scan
      - dynamodb:GetItem
      - dynamodb:PutItem
      - dynamodb:UpdateItem
      - dynamodb:DeleteItem
    Resource: 'arn:aws:dynamodb:us-east-1:*:*'

Can you post the full serverless.yml. The error seems to be saying that the iamRoleStatements is inside the environment variables.

@jayair It was an indentation issue. Thanks for your response!

1 Like