Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot publish into aws beanstalk from vs2019

I am trying to publish a .NET core 3.1 project from VS2019 into AWS Elastic Beanstalk. Once I fill all the information necessary for deployment and hit deploy, I get the following error on the 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?

like image 207
shawn_w8 Avatar asked Mar 03 '23 05:03

shawn_w8


1 Answers

You will have created an account which has the policy AWSElasticBeanstalkFullAccess. This account also needs to be allowed IAM:GetInstanceProfile permission.

As a quick test add the 'IAMFullAccess' policy to that account then try deploying. 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.

like image 146
DaWaugh Avatar answered Mar 11 '23 08:03

DaWaugh