Amazon web services 使用Powershell执行.Netcore Visual Studio AWS工具包';发布到AWS Lambda…&x27;

Amazon web services 使用Powershell执行.Netcore Visual Studio AWS工具包';发布到AWS Lambda…&x27;,amazon-web-services,powershell,.net-core,aws-lambda,aws-serverless,Amazon Web Services,Powershell,.net Core,Aws Lambda,Aws Serverless,我使用Visual Studio 2017和AWS工具包开发了一个.Net核心lambda函数。我在名为serverless.template的文件中有Cloudformation脚本,在名为aws-lambda-tools-defaults.json的文件中有部署配置。开发项目时,我一直在使用解决方案资源管理器中的“发布到AWS Lambda…”右键单击选项将其部署到AWS开发帐户 我现在准备将其部署到我们的暂存和生产AWS帐户,并需要使用Cloudformation执行“发布到AWS Lam

我使用Visual Studio 2017和AWS工具包开发了一个.Net核心lambda函数。我在名为serverless.template的文件中有Cloudformation脚本,在名为aws-lambda-tools-defaults.json的文件中有部署配置。开发项目时,我一直在使用解决方案资源管理器中的“发布到AWS Lambda…”右键单击选项将其部署到AWS开发帐户

我现在准备将其部署到我们的暂存和生产AWS帐户,并需要使用Cloudformation执行“发布到AWS Lambda…”部署步骤,我们的目标是创建Cloudformation更改集,以便在部署之前进行审查

我一直在尝试如何做,并尝试使用“aws cloudformation package”和“sam package”CLI命令,但我似乎找不到前进的方向

有人能帮我理解“发布到AWS Lambda…”执行的步骤吗?我想在Powershell中重现这些步骤,因为这将为我提供继续前进所需的理解


谢谢。

要从命令行部署,请使用for Lambda。它与从向导发布时在Visual Studio中运行的代码相同,并且可以读取默认文件等,因此无论是从IDE还是从命令行部署,都可以获得一致的部署体验

你提到你想了解幕后发生了什么-这些工具是开源的,所以你可以看看它在这方面为你做的所有工作。部署无服务器应用程序时,CloudFormation更改集会自动使用,您无需自行处理

该工具是一个.NET Core全局工具,您首先从命令行安装该工具:

dotnet tool install -g Amazon.Lambda.Tools
安装后,您可以获得帮助等:

PS C:\> dotnet lambda help
Amazon Lambda Tools for .NET Core applications (3.2.0)
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet



Commands to deploy and manage AWS Lambda functions:

        deploy-function         Command to deploy the project to AWS Lambda
        invoke-function         Command to invoke a function in Lambda with an optional input
        list-functions          Command to list all your Lambda functions
        delete-function         Command to delete a Lambda function
        get-function-config     Command to get the current runtime configuration for a Lambda function
        update-function-config  Command to update the runtime configuration for a Lambda function

Commands to deploy and manage AWS Serverless applications using AWS CloudFormation:

        deploy-serverless       Command to deploy an AWS Serverless application
        list-serverless         Command to list all your AWS Serverless applications
        delete-serverless       Command to delete an AWS Serverless application

Commands to publish and manage AWS Lambda Layers:

        publish-layer           Command to publish a Layer that can be associated with a Lambda function
        list-layers             Command to list Layers
        list-layer-versions     Command to list versions for a Layer
        get-layer-version       Command to get the details of a Layer version
        delete-layer-version    Command to delete a version of a Layer

Other Commands:

        package                 Command to package a Lambda project into a zip file ready for deployment
        package-ci              Command to use as part of a continuous integration system.

To get help on individual commands execute:
        dotnet lambda help <command>
这将读取默认文件中的设置并为您执行部署,就像您使用IDE向导一样


希望这与开源repo一起帮助您深入了解相关步骤。

要从命令行部署,请使用for Lambda。它与从向导发布时在Visual Studio中运行的代码相同,并且可以读取默认文件等,因此无论是从IDE还是从命令行部署,都可以获得一致的部署体验

你提到你想了解幕后发生了什么-这些工具是开源的,所以你可以看看它在这方面为你做的所有工作。部署无服务器应用程序时,CloudFormation更改集会自动使用,您无需自行处理

该工具是一个.NET Core全局工具,您首先从命令行安装该工具:

dotnet tool install -g Amazon.Lambda.Tools
安装后,您可以获得帮助等:

PS C:\> dotnet lambda help
Amazon Lambda Tools for .NET Core applications (3.2.0)
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet



Commands to deploy and manage AWS Lambda functions:

        deploy-function         Command to deploy the project to AWS Lambda
        invoke-function         Command to invoke a function in Lambda with an optional input
        list-functions          Command to list all your Lambda functions
        delete-function         Command to delete a Lambda function
        get-function-config     Command to get the current runtime configuration for a Lambda function
        update-function-config  Command to update the runtime configuration for a Lambda function

Commands to deploy and manage AWS Serverless applications using AWS CloudFormation:

        deploy-serverless       Command to deploy an AWS Serverless application
        list-serverless         Command to list all your AWS Serverless applications
        delete-serverless       Command to delete an AWS Serverless application

Commands to publish and manage AWS Lambda Layers:

        publish-layer           Command to publish a Layer that can be associated with a Lambda function
        list-layers             Command to list Layers
        list-layer-versions     Command to list versions for a Layer
        get-layer-version       Command to get the details of a Layer version
        delete-layer-version    Command to delete a version of a Layer

Other Commands:

        package                 Command to package a Lambda project into a zip file ready for deployment
        package-ci              Command to use as part of a continuous integration system.

To get help on individual commands execute:
        dotnet lambda help <command>
这将读取默认文件中的设置并为您执行部署,就像您使用IDE向导一样


希望这一点,结合开源回购协议,能帮助您深入了解相关步骤。

太好了,谢谢Steve。我一直在努力寻找,但不知何故错过了这个,所以我很高兴看到一个简单的解决方案。太好了,谢谢史蒂夫。我一直在努力寻找,但不知何故错过了这一点,所以我很高兴看到一个简单的解决方案。