早上好。我正在尝试使用CLI自动部署到我的c# lambda项目的AWS lambda。使用。net 3.1,我将做以下操作:
dotnet lambda deploy-serverless --configuration debug --stack-name custom-webhook-dev --s3-bucket custom-deployment-dev --template serverless.dev.template --region us-east-1 --s3-prefix custom-salesforce-integration-
这将照顾到我的部署到我的开发环境,而我的生产部署将是类似的,但用prod和debug代替dev发布。
但是在5.0中,我遇到了以下问题:
Amazon Lambda Tools for .NET Core applications (3.2.3)
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet
Processing CloudFormation resource AspNetCoreFunction
Initiate packaging of . for resource AspNetCoreFunction
Unknown error executing command: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary2.FindEntry(TKey key) at System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value)
at Amazon.Lambda.Tools.LambdaUtilities.DetermineTargetFrameworkFromLambdaRuntime(String lambdaRuntime, String projectLocation) in C:codebuildtmpoutputsrc109826539srcsrcAmazon.Lambda.ToolsLambdaUtilities.cs:line 38
at Amazon.Lambda.Tools.TemplateProcessor.TemplateProcessorManager.PackageDotnetProjectAsync(IUpdateResourceField field, String location) in C:codebuildtmpoutputsrc109826539srcsrcAmazon.Lambda.ToolsTemplateProcessorTemplateProcessorManager.cs:line 223
at Amazon.Lambda.Tools.TemplateProcessor.TemplateProcessorManager.ProcessUpdatableResourceAsync(String templateDirectory, IUpdateResourceField field) in C:codebuildtmpoutputsrc109826539srcsrcAmazon.Lambda.ToolsTemplateProcessorTemplateProcessorManager.cs:line 167
at Amazon.Lambda.Tools.TemplateProcessor.TemplateProcessorManager.TransformTemplateAsync(String templateDirectory, String templateBody) in C:codebuildtmpoutputsrc109826539srcsrcAmazon.Lambda.ToolsTemplateProcessorTemplateProcessorManager.cs:line 95
at Amazon.Lambda.Tools.Commands.DeployServerlessCommand.PerformActionAsync() in C:codebuildtmpoutputsrc109826539srcsrcAmazon.Lambda.ToolsCommandsDeployServerlessCommand.cs:line 167
at Amazon.Common.DotNetCli.Tools.Commands.BaseCommand1.ExecuteAsync() in C:codebuildtmpoutputsrc109826539srcsrcAmazon.Common.DotNetCli.ToolsCommandsBaseCommand.cs:line 44
它似乎错过了关键的DetermineTargetFrameworkFromLambdaRuntime
这个值应该是多少?我想做的只是自动部署到我的项目lambda,理想情况下,我想要一个文件部署到开发,和1个文件部署到生产。
它缺少的是"Runtime"这是3.1的设置。我应该在这个文件或命令行中添加这个吗?如果是,它的值应该是多少?
3.1模板的值为"Runtime": "dotnetcore3.1";提前谢谢你。
AWS Lambda还不支持.NET 5
。支持的版本有:
-
。. NET Core 3.1
-
。. NET Core 2.1
λ运行时.NET 5
由container images
支撑
。使用容器映像支持。NET 5 AWS Lambda