[object Object]

How to host ASP.NET websites on AWS (15 part series)

How-to written and screenshots taken on 2020 March 4

When we started with jodiBooks, Diana was fully in charge of creating and hosting our applications. My job was, well, to have a job and pay the rent. Back then, we decided it would be the best choice to start with the tools she was familiar with. That meant writing our applications in C# in the ASP.NET MVC framework. Two years later, I quit my job and started to assist with coding.

In the last 6 months we learned that we both have our strengths in this process. Diana is clearly the better software engineer, but I'm the better system administrator. Now that I started researching other hosting options, we quickly learned that we were using "old" techniques. Virtually everyone (well, everyone who writes tutorials) is using the .NET Core framework or something completely different (Node.js/JavaScript).

Host ASP.NET websites

In hindsight, we completely didn't research this at all. We just took what we (Diana) knew. Now we had a problem as migrating from ASP.NET to .NET Core is not a trivial exercise. It will take months to do this. Also finding documentation, tutorials and manuals on how to host ASP.NET sites are (getting) rare. Most are written with .NET core in mind. That's why I wrote an extensive manual on our website.

Contents

The tutorial shows how to host ASP.NET web applications in the AWS cloud. It describes how to use and configure the following AWS services:

The applications are hosted on a Windows 2019 machine in IIS 10. The database is run on the same machine in SQL Server Express 2017. As a bonus part 13 shows how to run a WordPress site on EC2.

Architecture

The tutorial also discusses the cloud architecture used. What I often miss in tutorials and manuals, is a basic sketch of the architecture. I don't have the skill of parsing the abstract ideas used by software engineers and experienced system administrators. I need to see what parts are used and how do they link together.

In this guide and all the ones I will write after, I'm going to include these sketches. I know that will be challenging, as for now the architecture is still really simple. As it grows, making these images will become more and more challenging. Especially as I want to make them comprehensible, not a big ball of spaghetti smacked flat in a 2D image.

possible future aws architecture application hosting

A possible future architecture. Our goal is to have migrated to .NET Core and containers by then.

The guide

So without further ado, here it is.

  1. Introduction
  2. Goals and requirements
  3. Architecture
  4. Users and roles with IAM
  5. Servers in EC2 part 1
  6. Servers in EC2 part 2
  7. Domains and DNS with Route 53
  8. Email with WorkMail and SES
  9. File (object) storage on S3
  10. ASP.NET sites in IIS
  11. Database in MS SQL server
  12. SSL certificates in IIS
  13. WordPress hosting on LEMP stack + SSL + S3
  14. Monitoring with Cloudwatch
  15. Backup scripting

Appendices:

  1. Appendix A: AWS services
  2. Appendix B: AWS pricing
  3. Appendix C: AWS training
  4. Appendix D: EC2 instance type selection
  5. Appendix E: Improved architectures