发布.NET Core中内置的AWS Lambda函数时出错 [英] Error in publishing an AWS Lambda function built in .NET Core

查看:127
本文介绍了发布.NET Core中内置的AWS Lambda函数时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自2016年12月1日起,AWS Lambda现在支持在.NET Core 1.0运行时中运行的C#函数.因此,我使用VS AWS Lambda模板创建了该函数.我试图通过VS中的发布到AWS Lambda ..."上下文菜单发布lambda函数.因此,在对话框中配置功能(选择S3存储桶,区域等)后,单击发布",然后在发布过程结束时出现错误:

As of Dec 1, 2016, AWS Lambda now supports functions in C# that runs in the .NET Core 1.0 runtime. So I created the function using the VS AWS Lambda Template. I tried to publish the lambda function via the "Publish to AWS Lambda..." context menu in VS. So after configuring the function(selecting the S3 bucket, region, etc) in the dialog box, I click publish and at the end of the publish process, I am getting error:

Error creating CloudFormation change set: User: arn:aws:iam::***:user/demo_user is not authorized to perform: cloudformation:CreateChangeSet on resource: arn:aws:cloudformation:us-east-1:****:stack/****

我认为我可以将策略附加/授予组/用户到cloudformation,但是我只能在选择项中看到此策略:AWSCloudFormationReadOnlyAccess

I figured I can just attach/grant a policy to the group/user to cloudformation but I can only see this policy in the selection: AWSCloudFormationReadOnlyAccess

我期望看到某种ReadWrite或FullAccess.

I was expecting to see some kind of ReadWrite or FullAccess.

需要帮助将该功能发布到AWS lambda.谢谢!

Need help publishing the function to AWS lambda. Thanks!

推荐答案

我认为这与要使用的帐户配置文件有关;需要允许此人发布lambda.

I believe this is related to the account profile to use; this one needs to be allowed to publish the lambda.

在Visual Studio中,右键单击AWS Lambda项目->发布,您会看到要发布的窗口. 顶部是要使用的帐户资料以及要发布到的地区;默认使用安装插件时使用的aws_user帐户

From within Visual Studio, when you right-click the AWS Lambda project -> Publish, you see the window to publish. At the top is the account profile to use and the Region where to publish to; default takes the aws_user account that you used when you installed the plugin

您可以尝试为您的用户提供AWSLambdaFullAccess策略,以便能够发布lambda.您可以在AWS的IAM控制台中执行此操作.

What you can try is to provide your own user the AWSLambdaFullAccess policy to be able to publish the lambda. You can do this within the IAM console of AWS.

除了使用上下文菜单外,您还可以尝试从dotnet cli命令行进行发布.

Instead of using the context menu, you could also try publishing from the dotnet cli command line.

  1. 在控制台中,转到您的.net核心项目所在的文件夹
  2. 您可以在此处使用dotnet lambda控制台功能.

这是因为dotnet cli能够从此文件夹中找到并使用位于程序包子文件夹/中的AWS程序包,或使用project.json来查找这些程序包.

this is because from this folder, the dotnet cli is able to find and use the AWS packages located in the packages subfolder / or uses project.json to locate those.

示例:

dotnet lambda软件包

dotnet lambda package

将建立&打包要发布的文件.

will build & package the to be published files.

dotnet lambda部署功能

dotnet lambda deploy-function

会将您的lambda函数发布到AWS Cloud.

will publish your lambda function to AWS Cloud.

这篇关于发布.NET Core中内置的AWS Lambda函数时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆