Guide To Building AWS Lambda Functions with Ease in JetBrains Rider

By admin
The

AWS Toolkit
ORG

plugin for JetBrains

Rider
PRODUCT

makes it easier to develop, debug, and deploy serverless applications with

AWS
ORG

right from your IDE. Learn how to setup

AWS Toolkit
ORG

and create

AWS Lambda Functions
ORG

from JetBrains

Rider IDE
PRODUCT

.

The

AWS Toolkit
ORG

plugin for JetBrains

Rider
PRODUCT

makes it easier to develop, debug, and deploy serverless applications with

AWS
ORG

right from your IDE.

In this blog post, let’s learn how to set up

the AWS Toolkit
ORG

and create

AWS Lambda Functions
ORG

from JetBrains

Rider IDE
PRODUCT

.

Install AWS Toolkit For JetBrains

Rider

PRODUCT


The AWS Toolkit
ORG

is available in the JetBrains marketplace. You can install this from within

the Rider IDE
PRODUCT

, by navigating to Settings → Plugins section and searching for ‘

AWS Toolkit’
ORG

.

Installing the AWS Toolkit Plugin from the Settings menu in JetBrains

Rider IDE
PRODUCT

.

Once installed you can see an additional icon, with the

AWS
ORG

logo (as shown in the screenshot below) on the left sidebar.


AWS Toolkit
ORG

in JetBrains

Rider

The Toolkit
PRODUCT

automatically picks up the

AWS
ORG

connection strings from the configuration file.

We learned how to set up the

AWS
ORG

credentials in an earlier article on

Learn How To Manage Credentials When Building .NET Application
ORG

on AWS.

Create Lambda Functions in JetBrains Rider

With the

AWS Toolkit
ORG

installed, we now have additional template options to create .NET projects.

We can create different starter templates for building

AWS Lambda Functions
ORG

.

Create an Empty Lambda Function in JetBrains Rider

To create an empty

Lambda Function
ORG

, search for ‘

Lambda Empty Function’
WORK_OF_ART

template under the ‘Add New Project’ dialog in

Rider
PRODUCT

.

Once you fill in the required

Solution Name
ORG

, Project Name, and the solution directory it generates a default

Lambda Function
PRODUCT

.NET project, with the below

FunctionHanlder Lambda
ORG

function.

public string FunctionHandler(string input, ILambdaContext context) { return input.ToUpper(); }


AWS Services
ORG

and

Lambda Function
ORG

in JetBrains

Rider

The AWS Toolkit for Rider
PRODUCT

also provides additional

Lambda
PRODUCT

templates that you can use as starter templates when building applications.

Based on your application and the different

AWS Service
ORG

you are integrating with, you can choose appropriate starter templates.

Below is an example of creating a Lambda Simple SQS Function template.

JetBrains

Rider Lambda Simple
PRODUCT

SQS Function template to integrate

Amazon
ORG


SQS
PRODUCT

with

AWS Lambda
PRODUCT

The template generates the required code to handle

SQSEvents
NORP

in

the AWS Function Handler
ORG

.

public async

Task
ORG

FunctionHandler(SQSEvent evnt, ILambdaContext context) { foreach (var message in evnt.Records) { await ProcessMessageAsync(message, context); } } private async

Task ProcessMessageAsync( SQSEvent
ORG

.

SQSMessage
NORP

message, ILambdaContext context) { context.Logger.

LogInformation($"Processed
PERSON

message {message.Body}"); // TODO: Do interesting work based on the new message await

Task
PRODUCT

.

CompletedTask
PRODUCT

; }

If you want to learn more about integrating with different

AWS Services
ORG

when building

Lambda Functions
ORG

check out my below blog post.

Debugging Lambda Function from JetBrains

Rider

The Mock Lambda Tool
PRODUCT

helps test the

Lambda
ORG

function locally without deploying it to an

AWS
ORG

environment.

📢 Note: This tool is not a local

Lambda
NORP

environment. This tool is optimized for quick local debugging with minimal dependencies.

You can set up

the Mock Lambda Test Tool
EVENT

to work with

Rider
PRODUCT

in

two
CARDINAL

ways

Using Rider .run file

Using launchsettings.json file

You can learn more in my blog post on How To Set Up AWS .NET Mock Lambda Test Tool on JetBrains

Rider
PRODUCT

.