Skip to main content

Posts

Showing posts from September, 2020

How to deploy Lambda function in AWS from developers machine?

  In previous post , we saw how to setup local development environment and test a Lambda function locally. As a developer, you may want to test the function in AWS environment quickly to make sure your code is working. In this post we will look at how to deploy the function in your AWS account. We will look at CI/CD pipeline to automatically build and deploy Lambda function in next post.  If you followed the instruction in previous post , you will notice there are three files in your solution LambdaEntrypoint.cs - This is the entrypoint for AWS Lambda.  aws-lambda-tools-defaults.json - This is the configuration file used by Lambda tooling. Update this file to add AWS profile you created while configuring AWS CLI and region you want to deploy your code. Note make sure you have this setting in your template as for some reason, it is missing from default template.  "function-runtime" : "netcoreapp3.1" , serverless.template - This is CloudFormation Serverless applicatio

How to get started with .Net Core and Lambda functions?

 Recently I started experimenting with .Net Core and AWS Lambda functions, I thought I will share the steps I took to get started Tools to install .Net Core 3.1 -  https://dotnet.microsoft.com/download/dotnet-core/3.1 AWS CLI -  https://aws.amazon.com/cli/   AWS Account - 12 months Free Tier -  https://aws.amazon.com/free Terminal - on iOS I use iTerm2 -  https://www.iterm2.com   Once you installed the above tools, head to AWS console and login with your root account to create an account which will be used by AWS CLI. Please see steps here   Now you can configure AWS CLI as detailed here . Verify that you able to connect to AWS service using CLI. To make life little easy with dotnet core and Lambda functions, you need to install AWS Extensions nuget pack for .Net CLI dotnet tool install -g Amazon.Lambda.Tools You can also install templates to get started quickly  dotnet new -i Amazon.Lambda.Templates That's it. Now the fun part!!!  Create a new project In terminal window, check the