aws-iot-lambda

All classes are under active development and subject to
non-backward compatible changes or removal in any future version.
These are not subject to the
Semantic Versioning
Language | Package |
---|---|
![]() |
aws_solutions_constructs.aws_iot_lambda
|
![]() |
@aws-solutions-constructs/aws-iot-lambda
|
![]() |
software.amazon.awsconstructs.services.iotlambda
|
This AWS Solutions Constructs pattern implements an AWS IoT MQTT topic rule and an AWS Lambda function pattern.
Here is a minimal deployable pattern definition in TypeScript:
import { IotToLambdaProps, IotToLambda } from '@aws-solutions-constructs/aws-iot-lambda'; const props: IotToLambdaProps = { lambdaFunctionProps: { code: lambda.Code.fromAsset(`${__dirname}/lambda`), runtime: lambda.Runtime.NODEJS_10_X, handler: 'index.handler' }, iotTopicRuleProps: { topicRulePayload: { ruleDisabled: false, description: "Processing of DTC messages from the AWS Connected Vehicle Solution.", sql: "SELECT * FROM 'connectedcar/dtc/#'", actions: [] } } }; new IotToLambda(this, 'test-iot-lambda-integration', props);
Initializer
new IotToLambda(scope: Construct, id: string, props: IotToLambdaProps);
Parameters
-
scope
Construct
-
id
string
-
props IotToLambdaProps
Pattern Construct Props
Name | Type | Description |
---|---|---|
existingLambdaObj? |
lambda.Function
|
An optional, existing Lambda function to be used instead of the default function.
If an existing function is provided, the lambdaFunctionProps property will be ignored.
|
lambdaFunctionProps? |
lambda.FunctionProps
|
Optional user-provided properties to override the default properties for the
Lambda function. Ignored if an existingLambdaObj is provided.
|
iotTopicRuleProps? |
iot.CfnTopicRuleProps
|
User provided CfnTopicRuleProps to override the defaults |
Pattern Properties
Name | Type | Description |
---|---|---|
iotTopicRule |
iot.CfnTopicRule
|
Returns an instance of the IoT topic rule created by the pattern. |
lambdaFunction |
lambda.Function
|
Returns an instance of the Lambda function created by the pattern. |
Default settings
Out-of-the-box implementation of this pattern without any overrides will set the following defaults:
Amazon IoT Rule
-
Configure least privilege access IAM role for Amazon IoT.
AWS Lambda Function
-
Configure limited privilege access IAM role for Lambda function.
-
Enable reusing connections with Keep-Alive for NodeJs Lambda function.
-
Enable X-Ray tracing.
-
Set environment variables:
-
AWS_NODEJS_CONNECTION_REUSE_ENABLED
(for Node 10.x and higher functions)
-
Architecture

GitHub
To view the code for this pattern, create/view issues and pull requests, and more: | |
---|---|
![]() |
@aws-solutions-constructs/aws-iot-lambda |