Registry / aws / aws-solutions-constructs-aws-iot-lambda

aws-solutions-constructs-aws-iot-lambda

JSON →
library2.102.0pypypiunverified

AWS Solutions Constructs implementation of the aws-iot-lambda pattern. This CDK construct deploys an AWS IoT rule that routes messages from an IoT topic to an AWS Lambda function for processing. Current version: 2.101.0. Release cadence: aligns with AWS CDK releases, approximately every 2 weeks.

pip install aws-solutions-constructs-aws-iot-lambda
INSTALL
IMPORT
SIG · AWS-SOLUTIONS-CONS
A
aws-solutions-constructs-aws-iot-lambda
awspythonv2.102.0
Install
19.2s avg
Import
Disk
398MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.102.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 359.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 19.2s · import 0.000s · 360MB
398MB installed
● package 398MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

IotToLambda
from aws_solutions_constructs.aws_iot_lambda import IotToLambda
Correct import path for the construct class
IotToLambdaProps
from aws_solutions_constructs.aws_iot_lambda import IotToLambdaProps
Correct import path for the props class
IotToLambda
from aws_solutions_constructs.aws_iot_lambda.aws_iot_lambda import IotToLambda
Incorrect nested import; the correct module is aws_iot_lambda at the top level

Quick start: deploy an IoT rule that sends messages to a Lambda function.

from aws_cdk import App, Stack from aws_solutions_constructs.aws_iot_lambda import IotToLambda, IotToLambdaProps from aws_cdk.aws_lambda import Code, Runtime from aws_cdk.aws_iot import TopicRuleProps app = App() stack = Stack(app, "test-iot-lambda-stack") # Create the construct with a Lambda function from inline code IotToLambda(stack, "test-iot-lambda", lambda_function_props={ "runtime": Runtime.PYTHON_3_9, "code": Code.from_inline( "def handler(event, context):\n print(event)\n" ), "handler": "index.handler" }, iot_topic_rule_props=TopicRuleProps( topic_rule_name="my_rule", sql="SELECT * FROM 'device/#'" ) ) app.synth()
Debug
Known issues
breakingCDK v2 migration: aws-solutions-constructs v2.x requires AWS CDK v2 and constructs v10.x. Ensure your project uses CDK v2 (aws-cdk-lib) and not the legacy CDK.
fix
Replace aws-cdk with aws-cdk-lib in your requirements and imports.
affects: >=2.0.0
deprecatedThe 'lambda_function_props' parameter is deprecated in favor of 'lambda_function_props' (note the removed underscore after 'lambda'). Both work, but the correct property name is 'lambda_function_props' with one underscore.
fix
Use 'lambda_function_props' (one underscore) instead of 'lambda_function_props' (two underscores).
affects: >=2.50.0
gotchaThe construct silently creates an S3 bucket for Lambda code if you don't specify an existing bucket. This bucket is not automatically cleaned up on stack deletion unless you set 'existingLambdaBucket' explicitly.
fix
To avoid orphaned buckets, set 'existingLambdaBucket' to a bucket with removal policy DESTROY or use 'autoDeleteObjects: true'.
affects: all
Upgrade
Version history
2.102.0latest on PyPI · released May 15, 2026
Audit
Dependencies
aws-cdk-librequiredRequired as peer dependency for CDK constructs
constructsrequiredRequired for CDK construct base class
Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
2
Resources
aws-solutions-constructs-aws-iot-lambda — pip install aws-solutions-constructs-aws-iot-lambda · libregistry