Problems trying to create an aws service using serverless

Asked

Viewed 23 times

-1

I am trying to create a service in AWS using serverless but when trying to execute the command sls deploy, I am presented with the following error: An error occurred: Iamrolelambdaexecution - Syntax errors in policy. (Service: Amazonidentitymanagement; Status Code: 400; Error Code: Malformedpolicydocument; Request ID: 79ded390-d2b7-4987-86a4-facaad77b2f7; Proxy: null).

this is my serverless.yml file


service: analysis

provider:
  name: aws
  runtime: nodejs12.x
  iamRoleStatements:
    - Effect: "Allow"
      Action:
        - rekognition: DetectLabels
      Resource: "*"

functions:
  analysis:
    handler: handler.main

    events:
      - http:
          path: analyse
          method: get

1 answer

0


It seems to me that the policy is in incorrect format, try as follows:

service: analysis

provider:
  name: aws
  runtime: nodejs12.x
  iamRoleStatements:
    - Effect: "Allow"
      Action:
        - 'rekognition:DetectLabels'
      Resource: "*"

functions:
  analysis:
    handler: handler.main

    events:
      - http:
          path: analyse
          method: get

Browser other questions tagged

You are not signed in. Login or sign up in order to post.