Amazon cloudformation AWS代码生成:跳过无效文件路径,上载\u工件状态:失败

Amazon cloudformation AWS代码生成:跳过无效文件路径,上载\u工件状态:失败,amazon-cloudformation,aws-cdk,aws-codepipeline,aws-codebuild,Amazon Cloudformation,Aws Cdk,Aws Codepipeline,Aws Codebuild,我有下面的buildspec.yml version: 0.2 phases: install: commands: - npm install -g aws-cdk@1.72.0 build: commands: - cd Lambda - cd NetworkRailGateway-Functions - for d in ./*/; do (npm install --only=prod); done -

我有下面的buildspec.yml

version: 0.2
phases:
  install:
    commands:
      - npm install -g aws-cdk@1.72.0
  build:
    commands:
      - cd Lambda
      - cd NetworkRailGateway-Functions
      - for d in ./*/; do (npm install --only=prod); done
      - cd .. 
      - cd RealtimeStations-Functions
      - for d in ./*/; do (npm install --only=prod); done
      - cd .. 
      - cdk synth > cfStack.yml
      - ls
      - pwd
artifacts:
  files:
    - cfStack.yml
ls命令显示当前目录中存在cfStack.yml文件,但是,我确实收到以下工件错误,这似乎意味着该文件不存在

[Container] 2021/05/20 14:10:51 Phase complete: POST_BUILD State: SUCCEEDED
[Container] 2021/05/20 14:10:51 Phase context status code:  Message: 
[Container] 2021/05/20 14:10:51 Expanding base directory path: .
[Container] 2021/05/20 14:10:51 Assembling file list
[Container] 2021/05/20 14:10:51 Expanding .
[Container] 2021/05/20 14:10:51 Expanding file paths for base directory .
[Container] 2021/05/20 14:10:51 Assembling file list
[Container] 2021/05/20 14:10:51 Expanding cfStack.yml
[Container] 2021/05/20 14:10:51 Skipping invalid file path cfStack.yml
[Container] 2021/05/20 14:10:51 Phase complete: UPLOAD_ARTIFACTS State: FAILED
[Container] 2021/05/20 14:10:51 Phase context status code: CLIENT_ERROR Message: no matching artifact paths found

我也尝试过./cfStack.yml,但没有成功。

看起来文件位于“Lambda”目录中。因此,您应该在direcotry名称前面加前缀,如下所示

人工制品: 文件夹: -“Lambda/cfStack.yml”

或者您应该如下设置基本目录

人工制品: 文件夹: -“cfStack.yml”
基本目录:“Lambda”

ls的输出是什么?
[Container]2021/05/20 14:10:51运行命令ls NetworkRailGateway Functions README.md RealtimeStations Functions cdk.context.json cdk.json cdk.out cfStack.yml src