AWS Solutions Constructs - IoT to Lambda

raw JSON →
2.101.0 verified Fri May 01 auth: no python

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
error ModuleNotFoundError: No module named 'aws_solutions_constructs.aws_iot_lambda'
cause The package name uses hyphens but the import path uses underscores. Additionally, the module name is 'aws_iot_lambda' (not 'aws_iot_lambda').
fix
Run: pip install aws-solutions-constructs-aws-iot-lambda. Then import: from aws_solutions_constructs.aws_iot_lambda import IotToLambda.
error Error: Cannot find module 'aws-solutions-constructs-aws-iot-lambda'
cause Trying to import the package directly in TypeScript-style (NPM). For Python, use pip and import via underscores.
fix
Install with pip and use Python import: from aws_solutions_constructs.aws_iot_lambda import IotToLambda.
error TypeError: '__init__() got an unexpected keyword argument 'lambda_function_props''
cause Using the deprecated 'lambda_function_props' parameter name (with two underscores). The correct parameter is 'lambda_function_props' with one underscore.
fix
Change 'lambda_function_props' to 'lambda_function_props' (single underscore after 'lambda').
breaking CDK 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.
deprecated The '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).
gotcha The 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'.