Search code examples
amazon-web-servicesaws-lambdaserverless

CREATE_FAILED: IamRoleLambdaExecution (AWS::IAM::Role)


How I fix this one.

Error: I am getting this error when deploy

serverless.yml


provider:
  name: aws
  runtime: nodejs12.x
  memorySize: 256
  stage: ${opt:stage, 'dev'}
  region: eu-west-1
  iamRoleStatements:
    - Effect: Allow
      Action:
        - dynamodb.PutItem
      Resource: 
        - arn:aws:dynamodb:#{AWS::Region}:#{AWS::AccountId}:table/AuctionsTable  

I am new to aws services and serverless app development when running sls deploy I am getting below error.


Solution

  • You have error in policy document, you used .(dot) in place of :(colon).

    iamRoleStatements:
        - Effect: Allow
          Action:
            - dynamodb:PutItem # use `:` here instead of `.`