映射条目的错误缩进 ... 操作

Bad indentation of a mapping entry in ... Action

我正在构建一个无服务器模板来读取 S3 存储桶,但是当我 运行 命令 serverless login 时出现此错误 错误bad indentation of a mapping entry in "xxxx\serverless.yml" at line 12, column 15: Action: ^

provider:
  name: aws
  runtime: python3.8

# you can overwrite defaults here
#  stage: dev
#  region: us-east-1

# you can add statements to the Lambda function's IAM Role here
  iamRoleStatements:
    - Effect: Allow
        Action:
          - s3:*
        Resource: ${self:custom.s3_role_resource}

Action 应与 Effect

对齐
iamRoleStatements:
  - Effect: Allow
    Action:
      - s3:*
    Resource: ${self:custom.s3_role_resource}