简体   繁体   English

无法从 vs2019 发布到 aws beanstalk

[英]Cannot publish into aws beanstalk from vs2019

I am trying to publish a .NET core 3.1 project from VS2019 into AWS Elastic Beanstalk.我正在尝试将 .NET 核心 3.1 项目从 VS2019 发布到 AWS Elastic Beanstalk 中。 Once I fill all the information necessary for deployment and hit deploy, I get the following error on the output.一旦我填写了部署所需的所有信息并点击部署,我在 output 上收到以下错误。

Unknown error executing command: One or more errors occurred.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Amazon.Common.DotNetCli.Tools.RoleHelper.ExpandInstanceProfile(IAmazonIdentityManagementService iamClient, String instanceProfile)
   at Amazon.Common.DotNetCli.Tools.Commands.BaseCommand`1.GetInstanceProfileOrDefault(String propertyValue, CommandOption option, Boolean required, String newRoleName)
   at Amazon.ElasticBeanstalk.Tools.Commands.DeployEnvironmentCommand.<CreateEnvironment>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Amazon.ElasticBeanstalk.Tools.Commands.DeployEnvironmentCommand.<PerformActionAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Amazon.Common.DotNetCli.Tools.Commands.BaseCommand`1.<ExecuteAsync>d__10.MoveNext()

Anyone else having trouble with this?还有其他人遇到这个问题吗?

You will have created an account which has the policy AWSElasticBeanstalkFullAccess.您将创建一个具有 AWSElasticBeanstalkFullAccess 策略的账户。 This account also needs to be allowed IAM:GetInstanceProfile permission.此帐户还需要获得 IAM:GetInstanceProfile 权限。

As a quick test add the 'IAMFullAccess' policy to that account then try deploying.作为快速测试,将“IAMFullAccess”策略添加到该帐户,然后尝试部署。 That should work.那应该行得通。 This violates the principle of least privilege though and isn't recommended on a production system - where you should enable only specific permissions.这违反了最小权限原则,并且不建议在生产系统上使用 - 您应该只启用特定权限。

At the "Options" stage of the AWS toolkit deployment it selects "Debug|Any CPU" by default.在 AWS 工具包部署的“选项”阶段,它默认选择“调试|任何 CPU”。 I was doing a deploy with my release build so I had to select "Release|Any CPU"我正在使用我的发布版本进行部署,所以我不得不 select "Release|Any CPU"

This resolved the same error for me in VS 2019这在 VS 2019 中为我解决了同样的错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM