Skip to content

An example project showing how to set up AWS Lambda Powertools for Typescript to help understand the behavior of the AWS IoT Rules Engine with AWS Lambda integration.

License

Notifications You must be signed in to change notification settings

aws-iot-builder-tools/aws-iot-rules-engine-to-lambda-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

AWS IoT Rules Engine with AWS Lambda Action Example

This is a project built and deployed using AWS SAM, and accompanies the blog on How to ensure resilience for your AWS IoT Rules Engine to AWS Lambda integration.

The small demo application shows a basic configuration of AWS Lambda Powertools for Typescript tracer and logger using descriptors.

The Service Map and tracing are created and used to understand the asynchronous invocation behaviour of AWS Lambda from the AWS IoT Rules Engine. To demonstrate how AWS IoT Rules Engine works when invoking AWS Lambda and how AWS Lambda behaves when invoked asynchronously, a small Typescript Lambda function, app.ts, was created to return an error. Because AWS Lambda is invoked asynchronously, we will see that the AWS IoT Rules Engine receives a 202 response from AWS Lambda, even if the function execution fails. Also, as the SAM template shows how configuring a Destination for the AWS Lambda failed events helps with ensuring resilience (that no data goes missing).

Have a look at the blog to learn more.

High Level Architecture

high-level-arch

Build and deploy the application

You can use AWS SAM to build and run this test application.

To use the SAM CLI, you need to install the following tools:

To build and deploy your application for the first time, run the following in your shell:

sam build
sam deploy --guided 

Resources

To learn more about the following tools and services, click on the links provided:

  1. AWS SAM.
  2. Asynchronous AWS Lambda invocations

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

About

An example project showing how to set up AWS Lambda Powertools for Typescript to help understand the behavior of the AWS IoT Rules Engine with AWS Lambda integration.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •