IamRoleLambdaExecution - синтаксические ошибки в политике - PullRequest
0 голосов
/ 26 мая 2020

Обращение к синтаксису IamRoleLambdaExecution - синтаксические ошибки в политике. (Служба: AmazonIdentityManagement; Код состояния: 400; Код ошибки: MalformedPolicyDocument; Идентификатор запроса: ******** - **** - **** - **** - ******** ****). для файла serverless.yml ниже.


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

1 Ответ

2 голосов
/ 27 мая 2020

На основании отзывов OP в комментарии изменение kinesis: "PutRecord" на "kinesis: PutRecord" должно работать.

...