Akkas Singh
Akkas Singh

Reputation: 53

IamRoleLambdaExecution - Syntax errors in policy

Facing Syntax IamRoleLambdaExecution - Syntax errors in policy. (Service: AmazonIdentityManagement; Status Code: 400; Error Code: MalformedPolicyDocument; Request ID: ********-****-****-****-************). for the below serverless.yml file.


plugins:
  - serverless-pseudo-parameters

provider:
  name: aws
  runtime: nodejs8.10

  iamRoleStatements:
    - Effect: Allow
      Action:
        - "dynamodb:PutItem"
        - "dynamodb:GetItem"
      Resource:
        - arn:aws:dynamodb:#{AWS::Region}:#{AWS::AccountId}:table/ordersTable
    - Effect: Allow
      Action:
        - kinesis: "PutRecord"
      Resource:
        - arn:aws:kinesis:#{AWS::Region}:#{AWS::AccountId}:stream/order-events

functions:
  createOrder:
    handler: handler.createOrder
    events:
      - http:
          path: /order
          method: post
    environment:
      orderTableName: ordersTable
      orderStreamName: order-events

resources:
  Resources:
    orderEventsStream:
      Type: AWS::Kinesis::Stream
      Properties:
        Name: order-events
        ShardCount: 1
    orderTable:
      Type: AWS::DynamoDB::Table
      Properties:
        TableName: ordersTable
        AttributeDefinitions:
          - AttributeName: "orderId"
            AttributeType: "S"
        KeySchema:
          - AttributeName: "orderId"
            KeyType: "HASH"
        BillingMode: PAY_PER_REQUEST```

serverless details:

- Framework Core: 1.71.3
- Plugin: 3.6.12
- SDK: 2.3.0
- Components: 2.30.11

Upvotes: 0

Views: 1853

Answers (1)

jellycsc
jellycsc

Reputation: 12359

Based on OP's feedback in the comment, changing kinesis: "PutRecord" to "kinesis: PutRecord" should work.

Upvotes: 4

Related Questions