【问题标题】:AWS Lambda CodePipeline can't fine my deps.json file?AWS Lambda CodePipeline 无法处理我的 deps.json 文件?
【发布时间】:2020-01-15 15:17:57
【问题描述】:

我正在尝试构建和部署一个简单的示例项目来学习 AWS。 C#/.NET 核心。

我的构建规范如下所示:

version: 0.2
phases:
  install:
    runtime-versions:
      dotnet: 2.2
  pre_build:
    commands:
      - echo Restore started on `date`
      - dotnet restore AWSServerless1.csproj
  build:
    commands:
      - echo Build started on `date`
      - dotnet publish -c release -o ./build_output AWSServerless1.csproj
artifacts:
  files:
    - ./build_output/**/*
    - scripts/**/*
    - appspec.yml
  discard-paths: yes

我的应用规范如下所示:

version: 0.0
Resources:
  - myStack-AspNetCoreFunction-1HPKUEU7I6GFW:
      Type: AWS::Lambda::Function
      Properties:
        Name: "myStack-AspNetCoreFunction-1HPKUEU7I6GFW"
        Alias: "AWSServerless1"
        CurrentVersion: "1"
        TargetVersion: "2"

管道成功完成,但是当我尝试运行 lambda 时,我得到一个 502。我检查了日志,它说:

Could not find the required 'AWSServerless1.deps.json'. This file should be present at the root of the deployment package.: LambdaException

当我从 S3 下载包时,对我来说,看起来一切都在那里。这是一个 zip 文件,没有任何路径,所有内容都在 zip 的根目录中,包括 AWSServerless1.deps.json。

有什么想法吗?

【问题讨论】:

    标签: amazon-web-services aws-lambda amazon-cloudformation aws-codepipeline


    【解决方案1】:

    使用 dotnet lambda 包而不是发布

    https://github.com/aws/aws-extensions-for-dotnet-cli

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-05
      • 1970-01-01
      • 1970-01-01
      • 2016-09-20
      • 1970-01-01
      • 2017-01-10
      • 2020-05-14
      • 1970-01-01
      相关资源
      最近更新 更多