In my previous blog post I gave an overview of how you can create a serverless application using .NET Core and AWS Lambda. In this blog post I will show a similar - yet quite different - programming model. Instead of using just plain .NET Core, I’ll be using ASP.NET Core with AWS Lambda. A quick reminder from my introductory blog post in this series may be in order.
Previously I gave an overview of the programming models when using NET Core with AWS Lambda, and I also showed how to create an image compressor in Lambda and C#. This time around we’ll put together a simple Web API with a couple of endpoints which can be called from any client application. The API I’ll create will utilize NodaTime library created by Jon Skeet to return a list of time zones based on the Time Zone database.
In this blog post we will look at how you can create a simple AWS Lambda function in C# (and .NET Core) which will compress images uploaded to an S3 bucket using the TinyPNG API. The Lambda function will be configured to automatically be triggered whenever a new image is uploaded to the S3 bucket. I am using Visual Studio 2017, so ensure you have downloaded and installed the Preview of the AWS Toolkit for Visual Studio 2017.
This blog post will provide you with a brief introduction to using C# and .NET Core with AWS Lambda and also look at the different programming models available when using .NET Core with Lambda. The reason why I started looking into this was because I wanted a dead simple hosting solution for GeoToast. And yeah, it has been a while since I have written about GeoToast. I spent a month in Japan, and sightseeing was higher on my list of priorities than coding…