Setting up deployment for .net 6 to AWS EC2


This Content is from ServerFault. Question asked by Randy Hall

(Lowly dev trying to play at devops)

I’ve successfully created an EC2 instance on an Amazon Linux platform.

I have a .net 6 API running locally, with the code base sitting in a private GitHub repo.

I have been through dozens of pages of setup instructions just trying to figure out how to deploy this application. There is no way that deploying one application to a server is this complex, but every AWS document on the matter branches out into 6 other ones.

None of it actually makes any sense to me, so when something goes wrong I don’t even know where I am.

I’m thinking this is a code -> server -> run situation.

So far it’s actually been “set up server” (dandy), set up a bunch of “groups” and “roles” and “circus troupes”, download an .msi and install a thing to allow a cmd app to connect a random JSON file to… umm what? I am missing something.

In a nutshell, what needs to happen to deploy an application to EC2?

Example of the Rabbit Hole:


I happen to have done the first four things so…

Create deployment group (and open accompanying AWS dashboard page)

Create a service role (and open accompanying AWS dashboard page)

Back to deployment group Tutorial (this still hasn’t told me how or why I’m doing any of these things, just that they need to be done)

I haven’t had this many tabs open at once since I lived on Mountain Dew.

Get an error and google it.

AWS CodeDeploy does not have the permissions required to assume the role

That’s step 5. Back to Tutorial.

Step 6.

Deploy the application

That sounds promising… oh that’s 9 more steps.

Get another permission issue, search again and figure out there are two json objects you need to update in a browser, text area input style, to make this work.

… Flat out guess at which permissions are needed for AmazonEC2. First guess, AmazonEC2FullAccess is apparently not full access to AmazonEC2. Second guess gets it, you specifically need AmazonEC2RoleforAWSCodeDeploy – at least the names are verbose.

Looks like that’s working… now I just have to figure out how to set up an SQL DB.


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from serverfault, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?