Skip to main content

CDK Constructs for AWS IoT to AWS Lambda integration

Project description

aws-iot-lambda module

---

Stability: Experimental

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 model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


Reference Documentation: https://docs.aws.amazon.com/solutions/latest/constructs/
Language Package
Python Logo Python aws_solutions_constructs.aws_iot_lambda
Typescript Logo Typescript @aws-solutions-constructs/aws-iot-lambda
Java Logo Java software.amazon.awsconstructs.services.iotlambda

This AWS Solutions Construct implements an AWS IoT MQTT topic rule and an AWS Lambda function pattern.

Here is a minimal deployable pattern definition in Typescript:

const { 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

Pattern Construct Props

Name Type Description
existingLambdaObj? lambda.Function Existing instance of Lambda Function object, if this is set then the lambdaFunctionProps is ignored.
lambdaFunctionProps? lambda.FunctionProps User provided props to override the default props for the Lambda function.
iotTopicRuleProps? iot.CfnTopicRuleProps User provided CfnTopicRuleProps to override the defaults

Pattern Properties

Name Type Description
iotTopicRule iot.CfnTopicRule Returns an instance of iot.CfnTopicRule created by the construct
lambdaFunction lambda.Function Returns an instance of lambda.Function created by the construct

Default settings

Out of the box implementation of the Construct without any override 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

Architecture

Architecture Diagram


© Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file aws-solutions-constructs.aws-iot-lambda-1.72.0.tar.gz.

File metadata

  • Download URL: aws-solutions-constructs.aws-iot-lambda-1.72.0.tar.gz
  • Upload date:
  • Size: 79.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.6

File hashes

Hashes for aws-solutions-constructs.aws-iot-lambda-1.72.0.tar.gz
Algorithm Hash digest
SHA256 b3e8d03712b01f2554bbf71d9451c9e4c885e5e118e642f926eb7a4f41cc7922
MD5 7590d07b24ae991943cc492726c787a7
BLAKE2b-256 57b8b0473fe68bf0032b265e0eaeb4eaa74b91589321ddc1b8139accc8153e0f

See more details on using hashes here.

File details

Details for the file aws_solutions_constructs.aws_iot_lambda-1.72.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_solutions_constructs.aws_iot_lambda-1.72.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ebc8d200b298fcbb522001632ea015e829520fff0d1fcadbf699555b80a87ed
MD5 0b0413d03c53fa4c3580779e13d0ca33
BLAKE2b-256 a846dc6e1e26b7b40d2c64fd0a51f1e08edc7600f7f51f23c154e888587f89bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page