Creating a simple, serverless app w/ AWS Lambda is fairly easy, but some documentation out there is outdated or using the preview toolkit. Below are some steps that show how to do this today, in a few steps. I’m using Visual Studio 2017. I’m also going to assume you already have your AWS credentials on your machine, if not, that’s a different topic.
- Install the AWS Toolkit for Visual Studio 2017 for Visual Studio. This is required to give you the project templates.
- Open Visual Studio and start a new project, choose “AWS Lambda Project” and give your project a name (I picked “awsLambdaTest”)
- At the Blueprint choice, choose “empty” then click “finish”.
- Your project will now create after a few seconds and should look like this:
- You can edit your code (in Function.cs)
- If you don’t edit anything and publish
- Now give your function a name and choose “next”:
- Now choose a role, the lambda_exec role is fine, then click “upload”.
- By default, the Lambda Function view will appear – this allows you to test your function. If you enter a string in the box under “sample input” and press “invoke”, you’ll see your function response.