iamRoleStatements yaml无服务器上的缩进错误

时间:2018-09-21 00:27:34

标签: function amazon-web-services aws-lambda aws-sdk serverless-framework

我正在为serverless.yml文件中的Lambda函数创建一个角色声明,但是我一直收到此错误

“映射条目缩进不良”

文件的外观如下:

iamRoleStatements: 
    - Effect: "Allow"
    Action:
        - "sns:Publish"
    Resource: "arn:aws:sns:*:*:*"
    - Effect: "Allow"
    Action:
        - "logs:CreateLogGroup"
    Resource: "arn:aws:logs:us-east-1:888186450240:*"

1 个答案:

答案 0 :(得分:3)

iamRoleStatements: 
    - Effect: "Allow"
      Action:
        - "sns:Publish"
      Resource: "arn:aws:sns:*:*:*"
    - Effect: "Allow"
      Action:
        - "logs:CreateLogGroup"
      Resource: "arn:aws:logs:us-east-1:888186450240:*"

iamRoleStatements是一个对象数组