.NET Core API to Aws Lambda One-Click Deployment on Visual Studio

Onur Vatan
3 min readMay 15, 2020

List of tools what I use your for that example

Open your Visual Studio and follow the path.

Create a new project Aws Serverless Application type.

Aws Serverless Application

There is a lot of AWS template. I choose the ASP.NET Core Web API template.

ASP.NET Core Web API template
First, look

After that creation complete we may see that in our solution explorer. But I have deleted those controllers and create my own RandomConroller as below.

Let’s Publish!

After that, you have to log in to your AWS console. There is AWS Explorer it is coming with Aws Toolkit.

We need to complete that login. Go to AWS Console and login to your account from browser and go to AWS IAM Management Security Credentials and create an Access key.

You have to create your secret file from your Access keys tab and import a CSV file.

After completion of the login, you can see your AWS object in the AWS Explorer. And now we are ready to deploy our API to AWS Lambda.

Right-click to your serverless.template and Publish to AWS Lambda…

After that write stack name and S3 bucket name. Press Publish and wait for the magic 🎉

There is a deployment status window.

You can copy the AWS Serverless URL and check the API.

Your serverless API is ready to use. If you check your AWS Lambda page. There is an API Gateway and Lamda Function created for your API deployment. Of course, you can do that deployment on AWS CLI too.

AWS Lambda Page

Lastly, AWS SAM is working for that operation in the background. I may try to do something with AWS SAM and AWS CloudFormation for next. Thank you for your reading.

--

--