AWS Codebuild:YAML_FILE_ERROR 消息:预期变量为地图类型:

AWS Codebuild: YAML_FILE_ERROR Message: Expected Variables to be of map type:

我在 buildspec.yaml 文件中收到 YAML 错误。错误是:

[Container] 2021/11/09 06:18:34 Waiting for agent ping
[Container] 2021/11/09 06:18:35 Waiting for DOWNLOAD_SOURCE
[Container] 2021/11/09 06:18:40 Phase is DOWNLOAD_SOURCE
[Container] 2021/11/09 06:18:40 CODEBUILD_SRC_DIR=/codebuild/output/src909937249/src/git-codecommit.us-east-2.amazonaws.com/v1/repos/nftytest
[Container] 2021/11/09 06:18:40 YAML location is /codebuild/readonly/buildspec.yml
[Container] 2021/11/09 06:18:42 Phase complete: DOWNLOAD_SOURCE State: FAILED
[Container] 2021/11/09 06:18:42 Phase context status code: YAML_FILE_ERROR Message: Expected Variables to be of map type: found string instead at line 5, check indentation or content around the line num

我的构建规范如下所示

version: 0.2

env:
  variables:
    CRYPTOGRAPHY_DONT_BUILD_RUST:"1"
phases:
  install:
    commands:
       - yum install python3 -y
       - python3 -m venv venv
       - source venv/bin/activate
       - curl https://sh.rustup.rs -sSf | sh -s -- -y
       - pip3 install -r requirements/local.txt

它在 CRYPTOGRAPHY_DONT_BUILD_RUST:"1" 行给出。

应该有一个space:

env:
  variables:
    CRYPTOGRAPHY_DONT_BUILD_RUST: "1"