aws-solutions-constructs.aws-iot-lambda 2.85.2__tar.gz → 2.85.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aws_solutions_constructs_aws_iot_lambda-2.85.3/PKG-INFO +28 -0
- aws_solutions_constructs_aws_iot_lambda-2.85.3/README.md +1 -0
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/setup.py +3 -3
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/src/aws_solutions_constructs/aws_iot_lambda/__init__.py +1 -156
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/src/aws_solutions_constructs/aws_iot_lambda/_jsii/__init__.py +2 -2
- aws_solutions_constructs_aws_iot_lambda-2.85.3/src/aws_solutions_constructs/aws_iot_lambda/_jsii/aws-iot-lambda@2.85.3.jsii.tgz +0 -0
- aws_solutions_constructs_aws_iot_lambda-2.85.3/src/aws_solutions_constructs.aws_iot_lambda.egg-info/PKG-INFO +28 -0
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/src/aws_solutions_constructs.aws_iot_lambda.egg-info/SOURCES.txt +1 -1
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/src/aws_solutions_constructs.aws_iot_lambda.egg-info/requires.txt +1 -1
- aws_solutions_constructs_aws_iot_lambda-2.85.2/PKG-INFO +0 -183
- aws_solutions_constructs_aws_iot_lambda-2.85.2/README.md +0 -156
- aws_solutions_constructs_aws_iot_lambda-2.85.2/src/aws_solutions_constructs/aws_iot_lambda/_jsii/aws-iot-lambda@2.85.2.jsii.tgz +0 -0
- aws_solutions_constructs_aws_iot_lambda-2.85.2/src/aws_solutions_constructs.aws_iot_lambda.egg-info/PKG-INFO +0 -183
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/LICENSE +0 -0
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/MANIFEST.in +0 -0
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/pyproject.toml +0 -0
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/setup.cfg +0 -0
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/src/aws_solutions_constructs/aws_iot_lambda/py.typed +0 -0
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/src/aws_solutions_constructs.aws_iot_lambda.egg-info/dependency_links.txt +0 -0
- {aws_solutions_constructs_aws_iot_lambda-2.85.2 → aws_solutions_constructs_aws_iot_lambda-2.85.3}/src/aws_solutions_constructs.aws_iot_lambda.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: aws-solutions-constructs.aws-iot-lambda
|
|
3
|
+
Version: 2.85.3
|
|
4
|
+
Summary: CDK Constructs for AWS IoT to AWS Lambda integration
|
|
5
|
+
Home-page: https://github.com/awslabs/aws-solutions-constructs.git
|
|
6
|
+
Author: Amazon Web Services
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Project-URL: Source, https://github.com/awslabs/aws-solutions-constructs.git
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: JavaScript
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Classifier: License :: OSI Approved
|
|
18
|
+
Requires-Python: ~=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: aws-cdk-lib<3.0.0,>=2.193.0
|
|
22
|
+
Requires-Dist: aws-solutions-constructs.core==2.85.3
|
|
23
|
+
Requires-Dist: constructs<11.0.0,>=10.0.0
|
|
24
|
+
Requires-Dist: jsii<2.0.0,>=1.111.0
|
|
25
|
+
Requires-Dist: publication>=0.0.3
|
|
26
|
+
Requires-Dist: typeguard<4.3.0,>=2.13.3
|
|
27
|
+
|
|
28
|
+
Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-iot-lambda/README.adoc)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-iot-lambda/README.adoc)
|
|
@@ -5,7 +5,7 @@ kwargs = json.loads(
|
|
|
5
5
|
"""
|
|
6
6
|
{
|
|
7
7
|
"name": "aws-solutions-constructs.aws-iot-lambda",
|
|
8
|
-
"version": "2.85.
|
|
8
|
+
"version": "2.85.3",
|
|
9
9
|
"description": "CDK Constructs for AWS IoT to AWS Lambda integration",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"url": "https://github.com/awslabs/aws-solutions-constructs.git",
|
|
@@ -26,7 +26,7 @@ kwargs = json.loads(
|
|
|
26
26
|
],
|
|
27
27
|
"package_data": {
|
|
28
28
|
"aws_solutions_constructs.aws_iot_lambda._jsii": [
|
|
29
|
-
"aws-iot-lambda@2.85.
|
|
29
|
+
"aws-iot-lambda@2.85.3.jsii.tgz"
|
|
30
30
|
],
|
|
31
31
|
"aws_solutions_constructs.aws_iot_lambda": [
|
|
32
32
|
"py.typed"
|
|
@@ -35,7 +35,7 @@ kwargs = json.loads(
|
|
|
35
35
|
"python_requires": "~=3.9",
|
|
36
36
|
"install_requires": [
|
|
37
37
|
"aws-cdk-lib>=2.193.0, <3.0.0",
|
|
38
|
-
"aws-solutions-constructs.core==2.85.
|
|
38
|
+
"aws-solutions-constructs.core==2.85.3",
|
|
39
39
|
"constructs>=10.0.0, <11.0.0",
|
|
40
40
|
"jsii>=1.111.0, <2.0.0",
|
|
41
41
|
"publication>=0.0.3",
|
|
@@ -1,160 +1,5 @@
|
|
|
1
1
|
r'''
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<!--BEGIN STABILITY BANNER-->---
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-

|
|
8
|
-
|
|
9
|
-
> All classes are under active development and subject to non-backward compatible changes or removal in any
|
|
10
|
-
> future version. These are not subject to the [Semantic Versioning](https://semver.org/) model.
|
|
11
|
-
> 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.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
<!--END STABILITY BANNER-->
|
|
15
|
-
|
|
16
|
-
| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
|
|
17
|
-
|:-------------|:-------------|
|
|
18
|
-
|
|
19
|
-
<div style="height:8px"></div>
|
|
20
|
-
|
|
21
|
-
| **Language** | **Package** |
|
|
22
|
-
|:-------------|-----------------|
|
|
23
|
-
| Python|`aws_solutions_constructs.aws_iot_lambda`|
|
|
24
|
-
| Typescript|`@aws-solutions-constructs/aws-iot-lambda`|
|
|
25
|
-
| Java|`software.amazon.awsconstructs.services.iotlambda`|
|
|
26
|
-
|
|
27
|
-
## Overview
|
|
28
|
-
|
|
29
|
-
This AWS Solutions Construct implements an AWS IoT MQTT topic rule and an AWS Lambda function pattern.
|
|
30
|
-
|
|
31
|
-
Here is a minimal deployable pattern definition:
|
|
32
|
-
|
|
33
|
-
Typescript
|
|
34
|
-
|
|
35
|
-
```python
|
|
36
|
-
import { Construct } from 'constructs';
|
|
37
|
-
import { Stack, StackProps } from 'aws-cdk-lib';
|
|
38
|
-
import { IotToLambdaProps, IotToLambda } from '@aws-solutions-constructs/aws-iot-lambda';
|
|
39
|
-
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
40
|
-
|
|
41
|
-
const constructProps: IotToLambdaProps = {
|
|
42
|
-
lambdaFunctionProps: {
|
|
43
|
-
code: lambda.Code.fromAsset(`lambda`),
|
|
44
|
-
runtime: lambda.Runtime.NODEJS_20_X,
|
|
45
|
-
handler: 'index.handler'
|
|
46
|
-
},
|
|
47
|
-
iotTopicRuleProps: {
|
|
48
|
-
topicRulePayload: {
|
|
49
|
-
ruleDisabled: false,
|
|
50
|
-
description: "Processing of DTC messages from the AWS Connected Vehicle Solution.",
|
|
51
|
-
sql: "SELECT * FROM 'connectedcar/dtc/#'",
|
|
52
|
-
actions: []
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
new IotToLambda(this, 'test-iot-lambda-integration', constructProps);
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Python
|
|
61
|
-
|
|
62
|
-
```python
|
|
63
|
-
from aws_solutions_constructs.aws_iot_lambda import IotToLambdaProps, IotToLambda
|
|
64
|
-
from aws_cdk import (
|
|
65
|
-
aws_iot as iot,
|
|
66
|
-
aws_lambda as _lambda,
|
|
67
|
-
Stack
|
|
68
|
-
)
|
|
69
|
-
from constructs import Construct
|
|
70
|
-
|
|
71
|
-
IotToLambda(self, 'test_iot_lambda',
|
|
72
|
-
lambda_function_props=_lambda.FunctionProps(
|
|
73
|
-
code=_lambda.Code.from_asset('lambda'),
|
|
74
|
-
runtime=_lambda.Runtime.PYTHON_3_11,
|
|
75
|
-
handler='index.handler'
|
|
76
|
-
),
|
|
77
|
-
iot_topic_rule_props=iot.CfnTopicRuleProps(
|
|
78
|
-
topic_rule_payload=iot.CfnTopicRule.TopicRulePayloadProperty(
|
|
79
|
-
rule_disabled=False,
|
|
80
|
-
description="Sends data to kinesis data stream",
|
|
81
|
-
sql="SELECT * FROM 'solutions/construct'",
|
|
82
|
-
actions=[]
|
|
83
|
-
)
|
|
84
|
-
))
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Java
|
|
88
|
-
|
|
89
|
-
```java
|
|
90
|
-
import software.constructs.Construct;
|
|
91
|
-
import java.util.List;
|
|
92
|
-
|
|
93
|
-
import software.amazon.awscdk.Stack;
|
|
94
|
-
import software.amazon.awscdk.StackProps;
|
|
95
|
-
import software.amazon.awscdk.services.lambda.*;
|
|
96
|
-
import software.amazon.awscdk.services.lambda.Runtime;
|
|
97
|
-
import software.amazon.awscdk.services.iot.*;
|
|
98
|
-
import software.amazon.awscdk.services.iot.CfnTopicRule.TopicRulePayloadProperty;
|
|
99
|
-
import software.amazon.awsconstructs.services.iotlambda.*;
|
|
100
|
-
|
|
101
|
-
new IotToLambda(this, "test-iot-lambda-integration", new IotToLambdaProps.Builder()
|
|
102
|
-
.lambdaFunctionProps(new FunctionProps.Builder()
|
|
103
|
-
.runtime(Runtime.NODEJS_20_X)
|
|
104
|
-
.code(Code.fromAsset("lambda"))
|
|
105
|
-
.handler("index.handler")
|
|
106
|
-
.build())
|
|
107
|
-
.iotTopicRuleProps(new CfnTopicRuleProps.Builder()
|
|
108
|
-
.topicRulePayload(new TopicRulePayloadProperty.Builder()
|
|
109
|
-
.ruleDisabled(false)
|
|
110
|
-
.description("Processing of DTC messages from the AWS Connected Vehicle Solution.")
|
|
111
|
-
.sql("SELECT * FROM 'connectedcar/dtc/#'")
|
|
112
|
-
.actions(List.of())
|
|
113
|
-
.build())
|
|
114
|
-
.build())
|
|
115
|
-
.build());
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## Pattern Construct Props
|
|
119
|
-
|
|
120
|
-
| **Name** | **Type** | **Description** |
|
|
121
|
-
|:-------------|:----------------|-----------------|
|
|
122
|
-
|existingLambdaObj?|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.|
|
|
123
|
-
|lambdaFunctionProps?|[`lambda.FunctionProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.FunctionProps.html)|User provided props to override the default props for the Lambda function.|
|
|
124
|
-
|iotTopicRuleProps?|[`iot.CfnTopicRuleProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnTopicRuleProps.html)|User provided CfnTopicRuleProps to override the defaults|
|
|
125
|
-
|
|
126
|
-
## Pattern Properties
|
|
127
|
-
|
|
128
|
-
| **Name** | **Type** | **Description** |
|
|
129
|
-
|:-------------|:----------------|-----------------|
|
|
130
|
-
|iotTopicRule|[`iot.CfnTopicRule`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnTopicRule.html)|Returns an instance of iot.CfnTopicRule created by the construct|
|
|
131
|
-
|lambdaFunction|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Returns an instance of lambda.Function created by the construct|
|
|
132
|
-
|
|
133
|
-
## Default settings
|
|
134
|
-
|
|
135
|
-
Out of the box implementation of the Construct without any override will set the following defaults:
|
|
136
|
-
|
|
137
|
-
### Amazon IoT Rule
|
|
138
|
-
|
|
139
|
-
* Configure least privilege access IAM role for Amazon IoT
|
|
140
|
-
|
|
141
|
-
### AWS Lambda Function
|
|
142
|
-
|
|
143
|
-
* Configure limited privilege access IAM role for Lambda function
|
|
144
|
-
* Enable reusing connections with Keep-Alive for NodeJs Lambda function
|
|
145
|
-
* Enable X-Ray Tracing
|
|
146
|
-
* Set Environment Variables
|
|
147
|
-
|
|
148
|
-
* AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
|
|
149
|
-
|
|
150
|
-
## Architecture
|
|
151
|
-
|
|
152
|
-

|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-iot-lambda/README.adoc)
|
|
158
3
|
'''
|
|
159
4
|
from pkgutil import extend_path
|
|
160
5
|
__path__ = extend_path(__path__, __name__)
|
|
@@ -34,9 +34,9 @@ import constructs._jsii
|
|
|
34
34
|
|
|
35
35
|
__jsii_assembly__ = jsii.JSIIAssembly.load(
|
|
36
36
|
"@aws-solutions-constructs/aws-iot-lambda",
|
|
37
|
-
"2.85.
|
|
37
|
+
"2.85.3",
|
|
38
38
|
__name__[0:-6],
|
|
39
|
-
"aws-iot-lambda@2.85.
|
|
39
|
+
"aws-iot-lambda@2.85.3.jsii.tgz",
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
__all__ = [
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: aws-solutions-constructs.aws-iot-lambda
|
|
3
|
+
Version: 2.85.3
|
|
4
|
+
Summary: CDK Constructs for AWS IoT to AWS Lambda integration
|
|
5
|
+
Home-page: https://github.com/awslabs/aws-solutions-constructs.git
|
|
6
|
+
Author: Amazon Web Services
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Project-URL: Source, https://github.com/awslabs/aws-solutions-constructs.git
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: JavaScript
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Classifier: License :: OSI Approved
|
|
18
|
+
Requires-Python: ~=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: aws-cdk-lib<3.0.0,>=2.193.0
|
|
22
|
+
Requires-Dist: aws-solutions-constructs.core==2.85.3
|
|
23
|
+
Requires-Dist: constructs<11.0.0,>=10.0.0
|
|
24
|
+
Requires-Dist: jsii<2.0.0,>=1.111.0
|
|
25
|
+
Requires-Dist: publication>=0.0.3
|
|
26
|
+
Requires-Dist: typeguard<4.3.0,>=2.13.3
|
|
27
|
+
|
|
28
|
+
Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-iot-lambda/README.adoc)
|
|
@@ -11,4 +11,4 @@ src/aws_solutions_constructs.aws_iot_lambda.egg-info/top_level.txt
|
|
|
11
11
|
src/aws_solutions_constructs/aws_iot_lambda/__init__.py
|
|
12
12
|
src/aws_solutions_constructs/aws_iot_lambda/py.typed
|
|
13
13
|
src/aws_solutions_constructs/aws_iot_lambda/_jsii/__init__.py
|
|
14
|
-
src/aws_solutions_constructs/aws_iot_lambda/_jsii/aws-iot-lambda@2.85.
|
|
14
|
+
src/aws_solutions_constructs/aws_iot_lambda/_jsii/aws-iot-lambda@2.85.3.jsii.tgz
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: aws-solutions-constructs.aws-iot-lambda
|
|
3
|
-
Version: 2.85.2
|
|
4
|
-
Summary: CDK Constructs for AWS IoT to AWS Lambda integration
|
|
5
|
-
Home-page: https://github.com/awslabs/aws-solutions-constructs.git
|
|
6
|
-
Author: Amazon Web Services
|
|
7
|
-
License: Apache-2.0
|
|
8
|
-
Project-URL: Source, https://github.com/awslabs/aws-solutions-constructs.git
|
|
9
|
-
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Programming Language :: JavaScript
|
|
12
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
-
Classifier: Typing :: Typed
|
|
17
|
-
Classifier: License :: OSI Approved
|
|
18
|
-
Requires-Python: ~=3.9
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
License-File: LICENSE
|
|
21
|
-
Requires-Dist: aws-cdk-lib<3.0.0,>=2.193.0
|
|
22
|
-
Requires-Dist: aws-solutions-constructs.core==2.85.2
|
|
23
|
-
Requires-Dist: constructs<11.0.0,>=10.0.0
|
|
24
|
-
Requires-Dist: jsii<2.0.0,>=1.111.0
|
|
25
|
-
Requires-Dist: publication>=0.0.3
|
|
26
|
-
Requires-Dist: typeguard<4.3.0,>=2.13.3
|
|
27
|
-
|
|
28
|
-
# aws-iot-lambda module
|
|
29
|
-
|
|
30
|
-
<!--BEGIN STABILITY BANNER-->---
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-

|
|
34
|
-
|
|
35
|
-
> All classes are under active development and subject to non-backward compatible changes or removal in any
|
|
36
|
-
> future version. These are not subject to the [Semantic Versioning](https://semver.org/) model.
|
|
37
|
-
> 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.
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
<!--END STABILITY BANNER-->
|
|
41
|
-
|
|
42
|
-
| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
|
|
43
|
-
|:-------------|:-------------|
|
|
44
|
-
|
|
45
|
-
<div style="height:8px"></div>
|
|
46
|
-
|
|
47
|
-
| **Language** | **Package** |
|
|
48
|
-
|:-------------|-----------------|
|
|
49
|
-
| Python|`aws_solutions_constructs.aws_iot_lambda`|
|
|
50
|
-
| Typescript|`@aws-solutions-constructs/aws-iot-lambda`|
|
|
51
|
-
| Java|`software.amazon.awsconstructs.services.iotlambda`|
|
|
52
|
-
|
|
53
|
-
## Overview
|
|
54
|
-
|
|
55
|
-
This AWS Solutions Construct implements an AWS IoT MQTT topic rule and an AWS Lambda function pattern.
|
|
56
|
-
|
|
57
|
-
Here is a minimal deployable pattern definition:
|
|
58
|
-
|
|
59
|
-
Typescript
|
|
60
|
-
|
|
61
|
-
```python
|
|
62
|
-
import { Construct } from 'constructs';
|
|
63
|
-
import { Stack, StackProps } from 'aws-cdk-lib';
|
|
64
|
-
import { IotToLambdaProps, IotToLambda } from '@aws-solutions-constructs/aws-iot-lambda';
|
|
65
|
-
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
66
|
-
|
|
67
|
-
const constructProps: IotToLambdaProps = {
|
|
68
|
-
lambdaFunctionProps: {
|
|
69
|
-
code: lambda.Code.fromAsset(`lambda`),
|
|
70
|
-
runtime: lambda.Runtime.NODEJS_20_X,
|
|
71
|
-
handler: 'index.handler'
|
|
72
|
-
},
|
|
73
|
-
iotTopicRuleProps: {
|
|
74
|
-
topicRulePayload: {
|
|
75
|
-
ruleDisabled: false,
|
|
76
|
-
description: "Processing of DTC messages from the AWS Connected Vehicle Solution.",
|
|
77
|
-
sql: "SELECT * FROM 'connectedcar/dtc/#'",
|
|
78
|
-
actions: []
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
new IotToLambda(this, 'test-iot-lambda-integration', constructProps);
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Python
|
|
87
|
-
|
|
88
|
-
```python
|
|
89
|
-
from aws_solutions_constructs.aws_iot_lambda import IotToLambdaProps, IotToLambda
|
|
90
|
-
from aws_cdk import (
|
|
91
|
-
aws_iot as iot,
|
|
92
|
-
aws_lambda as _lambda,
|
|
93
|
-
Stack
|
|
94
|
-
)
|
|
95
|
-
from constructs import Construct
|
|
96
|
-
|
|
97
|
-
IotToLambda(self, 'test_iot_lambda',
|
|
98
|
-
lambda_function_props=_lambda.FunctionProps(
|
|
99
|
-
code=_lambda.Code.from_asset('lambda'),
|
|
100
|
-
runtime=_lambda.Runtime.PYTHON_3_11,
|
|
101
|
-
handler='index.handler'
|
|
102
|
-
),
|
|
103
|
-
iot_topic_rule_props=iot.CfnTopicRuleProps(
|
|
104
|
-
topic_rule_payload=iot.CfnTopicRule.TopicRulePayloadProperty(
|
|
105
|
-
rule_disabled=False,
|
|
106
|
-
description="Sends data to kinesis data stream",
|
|
107
|
-
sql="SELECT * FROM 'solutions/construct'",
|
|
108
|
-
actions=[]
|
|
109
|
-
)
|
|
110
|
-
))
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Java
|
|
114
|
-
|
|
115
|
-
```java
|
|
116
|
-
import software.constructs.Construct;
|
|
117
|
-
import java.util.List;
|
|
118
|
-
|
|
119
|
-
import software.amazon.awscdk.Stack;
|
|
120
|
-
import software.amazon.awscdk.StackProps;
|
|
121
|
-
import software.amazon.awscdk.services.lambda.*;
|
|
122
|
-
import software.amazon.awscdk.services.lambda.Runtime;
|
|
123
|
-
import software.amazon.awscdk.services.iot.*;
|
|
124
|
-
import software.amazon.awscdk.services.iot.CfnTopicRule.TopicRulePayloadProperty;
|
|
125
|
-
import software.amazon.awsconstructs.services.iotlambda.*;
|
|
126
|
-
|
|
127
|
-
new IotToLambda(this, "test-iot-lambda-integration", new IotToLambdaProps.Builder()
|
|
128
|
-
.lambdaFunctionProps(new FunctionProps.Builder()
|
|
129
|
-
.runtime(Runtime.NODEJS_20_X)
|
|
130
|
-
.code(Code.fromAsset("lambda"))
|
|
131
|
-
.handler("index.handler")
|
|
132
|
-
.build())
|
|
133
|
-
.iotTopicRuleProps(new CfnTopicRuleProps.Builder()
|
|
134
|
-
.topicRulePayload(new TopicRulePayloadProperty.Builder()
|
|
135
|
-
.ruleDisabled(false)
|
|
136
|
-
.description("Processing of DTC messages from the AWS Connected Vehicle Solution.")
|
|
137
|
-
.sql("SELECT * FROM 'connectedcar/dtc/#'")
|
|
138
|
-
.actions(List.of())
|
|
139
|
-
.build())
|
|
140
|
-
.build())
|
|
141
|
-
.build());
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## Pattern Construct Props
|
|
145
|
-
|
|
146
|
-
| **Name** | **Type** | **Description** |
|
|
147
|
-
|:-------------|:----------------|-----------------|
|
|
148
|
-
|existingLambdaObj?|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.|
|
|
149
|
-
|lambdaFunctionProps?|[`lambda.FunctionProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.FunctionProps.html)|User provided props to override the default props for the Lambda function.|
|
|
150
|
-
|iotTopicRuleProps?|[`iot.CfnTopicRuleProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnTopicRuleProps.html)|User provided CfnTopicRuleProps to override the defaults|
|
|
151
|
-
|
|
152
|
-
## Pattern Properties
|
|
153
|
-
|
|
154
|
-
| **Name** | **Type** | **Description** |
|
|
155
|
-
|:-------------|:----------------|-----------------|
|
|
156
|
-
|iotTopicRule|[`iot.CfnTopicRule`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnTopicRule.html)|Returns an instance of iot.CfnTopicRule created by the construct|
|
|
157
|
-
|lambdaFunction|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Returns an instance of lambda.Function created by the construct|
|
|
158
|
-
|
|
159
|
-
## Default settings
|
|
160
|
-
|
|
161
|
-
Out of the box implementation of the Construct without any override will set the following defaults:
|
|
162
|
-
|
|
163
|
-
### Amazon IoT Rule
|
|
164
|
-
|
|
165
|
-
* Configure least privilege access IAM role for Amazon IoT
|
|
166
|
-
|
|
167
|
-
### AWS Lambda Function
|
|
168
|
-
|
|
169
|
-
* Configure limited privilege access IAM role for Lambda function
|
|
170
|
-
* Enable reusing connections with Keep-Alive for NodeJs Lambda function
|
|
171
|
-
* Enable X-Ray Tracing
|
|
172
|
-
* Set Environment Variables
|
|
173
|
-
|
|
174
|
-
* AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
|
|
175
|
-
|
|
176
|
-
## Architecture
|
|
177
|
-
|
|
178
|
-

|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
# aws-iot-lambda module
|
|
2
|
-
|
|
3
|
-
<!--BEGIN STABILITY BANNER-->---
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
> All classes are under active development and subject to non-backward compatible changes or removal in any
|
|
9
|
-
> future version. These are not subject to the [Semantic Versioning](https://semver.org/) model.
|
|
10
|
-
> 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.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
<!--END STABILITY BANNER-->
|
|
14
|
-
|
|
15
|
-
| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
|
|
16
|
-
|:-------------|:-------------|
|
|
17
|
-
|
|
18
|
-
<div style="height:8px"></div>
|
|
19
|
-
|
|
20
|
-
| **Language** | **Package** |
|
|
21
|
-
|:-------------|-----------------|
|
|
22
|
-
| Python|`aws_solutions_constructs.aws_iot_lambda`|
|
|
23
|
-
| Typescript|`@aws-solutions-constructs/aws-iot-lambda`|
|
|
24
|
-
| Java|`software.amazon.awsconstructs.services.iotlambda`|
|
|
25
|
-
|
|
26
|
-
## Overview
|
|
27
|
-
|
|
28
|
-
This AWS Solutions Construct implements an AWS IoT MQTT topic rule and an AWS Lambda function pattern.
|
|
29
|
-
|
|
30
|
-
Here is a minimal deployable pattern definition:
|
|
31
|
-
|
|
32
|
-
Typescript
|
|
33
|
-
|
|
34
|
-
```python
|
|
35
|
-
import { Construct } from 'constructs';
|
|
36
|
-
import { Stack, StackProps } from 'aws-cdk-lib';
|
|
37
|
-
import { IotToLambdaProps, IotToLambda } from '@aws-solutions-constructs/aws-iot-lambda';
|
|
38
|
-
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
39
|
-
|
|
40
|
-
const constructProps: IotToLambdaProps = {
|
|
41
|
-
lambdaFunctionProps: {
|
|
42
|
-
code: lambda.Code.fromAsset(`lambda`),
|
|
43
|
-
runtime: lambda.Runtime.NODEJS_20_X,
|
|
44
|
-
handler: 'index.handler'
|
|
45
|
-
},
|
|
46
|
-
iotTopicRuleProps: {
|
|
47
|
-
topicRulePayload: {
|
|
48
|
-
ruleDisabled: false,
|
|
49
|
-
description: "Processing of DTC messages from the AWS Connected Vehicle Solution.",
|
|
50
|
-
sql: "SELECT * FROM 'connectedcar/dtc/#'",
|
|
51
|
-
actions: []
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
new IotToLambda(this, 'test-iot-lambda-integration', constructProps);
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Python
|
|
60
|
-
|
|
61
|
-
```python
|
|
62
|
-
from aws_solutions_constructs.aws_iot_lambda import IotToLambdaProps, IotToLambda
|
|
63
|
-
from aws_cdk import (
|
|
64
|
-
aws_iot as iot,
|
|
65
|
-
aws_lambda as _lambda,
|
|
66
|
-
Stack
|
|
67
|
-
)
|
|
68
|
-
from constructs import Construct
|
|
69
|
-
|
|
70
|
-
IotToLambda(self, 'test_iot_lambda',
|
|
71
|
-
lambda_function_props=_lambda.FunctionProps(
|
|
72
|
-
code=_lambda.Code.from_asset('lambda'),
|
|
73
|
-
runtime=_lambda.Runtime.PYTHON_3_11,
|
|
74
|
-
handler='index.handler'
|
|
75
|
-
),
|
|
76
|
-
iot_topic_rule_props=iot.CfnTopicRuleProps(
|
|
77
|
-
topic_rule_payload=iot.CfnTopicRule.TopicRulePayloadProperty(
|
|
78
|
-
rule_disabled=False,
|
|
79
|
-
description="Sends data to kinesis data stream",
|
|
80
|
-
sql="SELECT * FROM 'solutions/construct'",
|
|
81
|
-
actions=[]
|
|
82
|
-
)
|
|
83
|
-
))
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Java
|
|
87
|
-
|
|
88
|
-
```java
|
|
89
|
-
import software.constructs.Construct;
|
|
90
|
-
import java.util.List;
|
|
91
|
-
|
|
92
|
-
import software.amazon.awscdk.Stack;
|
|
93
|
-
import software.amazon.awscdk.StackProps;
|
|
94
|
-
import software.amazon.awscdk.services.lambda.*;
|
|
95
|
-
import software.amazon.awscdk.services.lambda.Runtime;
|
|
96
|
-
import software.amazon.awscdk.services.iot.*;
|
|
97
|
-
import software.amazon.awscdk.services.iot.CfnTopicRule.TopicRulePayloadProperty;
|
|
98
|
-
import software.amazon.awsconstructs.services.iotlambda.*;
|
|
99
|
-
|
|
100
|
-
new IotToLambda(this, "test-iot-lambda-integration", new IotToLambdaProps.Builder()
|
|
101
|
-
.lambdaFunctionProps(new FunctionProps.Builder()
|
|
102
|
-
.runtime(Runtime.NODEJS_20_X)
|
|
103
|
-
.code(Code.fromAsset("lambda"))
|
|
104
|
-
.handler("index.handler")
|
|
105
|
-
.build())
|
|
106
|
-
.iotTopicRuleProps(new CfnTopicRuleProps.Builder()
|
|
107
|
-
.topicRulePayload(new TopicRulePayloadProperty.Builder()
|
|
108
|
-
.ruleDisabled(false)
|
|
109
|
-
.description("Processing of DTC messages from the AWS Connected Vehicle Solution.")
|
|
110
|
-
.sql("SELECT * FROM 'connectedcar/dtc/#'")
|
|
111
|
-
.actions(List.of())
|
|
112
|
-
.build())
|
|
113
|
-
.build())
|
|
114
|
-
.build());
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Pattern Construct Props
|
|
118
|
-
|
|
119
|
-
| **Name** | **Type** | **Description** |
|
|
120
|
-
|:-------------|:----------------|-----------------|
|
|
121
|
-
|existingLambdaObj?|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.|
|
|
122
|
-
|lambdaFunctionProps?|[`lambda.FunctionProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.FunctionProps.html)|User provided props to override the default props for the Lambda function.|
|
|
123
|
-
|iotTopicRuleProps?|[`iot.CfnTopicRuleProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnTopicRuleProps.html)|User provided CfnTopicRuleProps to override the defaults|
|
|
124
|
-
|
|
125
|
-
## Pattern Properties
|
|
126
|
-
|
|
127
|
-
| **Name** | **Type** | **Description** |
|
|
128
|
-
|:-------------|:----------------|-----------------|
|
|
129
|
-
|iotTopicRule|[`iot.CfnTopicRule`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnTopicRule.html)|Returns an instance of iot.CfnTopicRule created by the construct|
|
|
130
|
-
|lambdaFunction|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Returns an instance of lambda.Function created by the construct|
|
|
131
|
-
|
|
132
|
-
## Default settings
|
|
133
|
-
|
|
134
|
-
Out of the box implementation of the Construct without any override will set the following defaults:
|
|
135
|
-
|
|
136
|
-
### Amazon IoT Rule
|
|
137
|
-
|
|
138
|
-
* Configure least privilege access IAM role for Amazon IoT
|
|
139
|
-
|
|
140
|
-
### AWS Lambda Function
|
|
141
|
-
|
|
142
|
-
* Configure limited privilege access IAM role for Lambda function
|
|
143
|
-
* Enable reusing connections with Keep-Alive for NodeJs Lambda function
|
|
144
|
-
* Enable X-Ray Tracing
|
|
145
|
-
* Set Environment Variables
|
|
146
|
-
|
|
147
|
-
* AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
|
|
148
|
-
|
|
149
|
-
## Architecture
|
|
150
|
-
|
|
151
|
-

|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
Binary file
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: aws-solutions-constructs.aws-iot-lambda
|
|
3
|
-
Version: 2.85.2
|
|
4
|
-
Summary: CDK Constructs for AWS IoT to AWS Lambda integration
|
|
5
|
-
Home-page: https://github.com/awslabs/aws-solutions-constructs.git
|
|
6
|
-
Author: Amazon Web Services
|
|
7
|
-
License: Apache-2.0
|
|
8
|
-
Project-URL: Source, https://github.com/awslabs/aws-solutions-constructs.git
|
|
9
|
-
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Programming Language :: JavaScript
|
|
12
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
-
Classifier: Typing :: Typed
|
|
17
|
-
Classifier: License :: OSI Approved
|
|
18
|
-
Requires-Python: ~=3.9
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
License-File: LICENSE
|
|
21
|
-
Requires-Dist: aws-cdk-lib<3.0.0,>=2.193.0
|
|
22
|
-
Requires-Dist: aws-solutions-constructs.core==2.85.2
|
|
23
|
-
Requires-Dist: constructs<11.0.0,>=10.0.0
|
|
24
|
-
Requires-Dist: jsii<2.0.0,>=1.111.0
|
|
25
|
-
Requires-Dist: publication>=0.0.3
|
|
26
|
-
Requires-Dist: typeguard<4.3.0,>=2.13.3
|
|
27
|
-
|
|
28
|
-
# aws-iot-lambda module
|
|
29
|
-
|
|
30
|
-
<!--BEGIN STABILITY BANNER-->---
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-

|
|
34
|
-
|
|
35
|
-
> All classes are under active development and subject to non-backward compatible changes or removal in any
|
|
36
|
-
> future version. These are not subject to the [Semantic Versioning](https://semver.org/) model.
|
|
37
|
-
> 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.
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
<!--END STABILITY BANNER-->
|
|
41
|
-
|
|
42
|
-
| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
|
|
43
|
-
|:-------------|:-------------|
|
|
44
|
-
|
|
45
|
-
<div style="height:8px"></div>
|
|
46
|
-
|
|
47
|
-
| **Language** | **Package** |
|
|
48
|
-
|:-------------|-----------------|
|
|
49
|
-
| Python|`aws_solutions_constructs.aws_iot_lambda`|
|
|
50
|
-
| Typescript|`@aws-solutions-constructs/aws-iot-lambda`|
|
|
51
|
-
| Java|`software.amazon.awsconstructs.services.iotlambda`|
|
|
52
|
-
|
|
53
|
-
## Overview
|
|
54
|
-
|
|
55
|
-
This AWS Solutions Construct implements an AWS IoT MQTT topic rule and an AWS Lambda function pattern.
|
|
56
|
-
|
|
57
|
-
Here is a minimal deployable pattern definition:
|
|
58
|
-
|
|
59
|
-
Typescript
|
|
60
|
-
|
|
61
|
-
```python
|
|
62
|
-
import { Construct } from 'constructs';
|
|
63
|
-
import { Stack, StackProps } from 'aws-cdk-lib';
|
|
64
|
-
import { IotToLambdaProps, IotToLambda } from '@aws-solutions-constructs/aws-iot-lambda';
|
|
65
|
-
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
66
|
-
|
|
67
|
-
const constructProps: IotToLambdaProps = {
|
|
68
|
-
lambdaFunctionProps: {
|
|
69
|
-
code: lambda.Code.fromAsset(`lambda`),
|
|
70
|
-
runtime: lambda.Runtime.NODEJS_20_X,
|
|
71
|
-
handler: 'index.handler'
|
|
72
|
-
},
|
|
73
|
-
iotTopicRuleProps: {
|
|
74
|
-
topicRulePayload: {
|
|
75
|
-
ruleDisabled: false,
|
|
76
|
-
description: "Processing of DTC messages from the AWS Connected Vehicle Solution.",
|
|
77
|
-
sql: "SELECT * FROM 'connectedcar/dtc/#'",
|
|
78
|
-
actions: []
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
new IotToLambda(this, 'test-iot-lambda-integration', constructProps);
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Python
|
|
87
|
-
|
|
88
|
-
```python
|
|
89
|
-
from aws_solutions_constructs.aws_iot_lambda import IotToLambdaProps, IotToLambda
|
|
90
|
-
from aws_cdk import (
|
|
91
|
-
aws_iot as iot,
|
|
92
|
-
aws_lambda as _lambda,
|
|
93
|
-
Stack
|
|
94
|
-
)
|
|
95
|
-
from constructs import Construct
|
|
96
|
-
|
|
97
|
-
IotToLambda(self, 'test_iot_lambda',
|
|
98
|
-
lambda_function_props=_lambda.FunctionProps(
|
|
99
|
-
code=_lambda.Code.from_asset('lambda'),
|
|
100
|
-
runtime=_lambda.Runtime.PYTHON_3_11,
|
|
101
|
-
handler='index.handler'
|
|
102
|
-
),
|
|
103
|
-
iot_topic_rule_props=iot.CfnTopicRuleProps(
|
|
104
|
-
topic_rule_payload=iot.CfnTopicRule.TopicRulePayloadProperty(
|
|
105
|
-
rule_disabled=False,
|
|
106
|
-
description="Sends data to kinesis data stream",
|
|
107
|
-
sql="SELECT * FROM 'solutions/construct'",
|
|
108
|
-
actions=[]
|
|
109
|
-
)
|
|
110
|
-
))
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Java
|
|
114
|
-
|
|
115
|
-
```java
|
|
116
|
-
import software.constructs.Construct;
|
|
117
|
-
import java.util.List;
|
|
118
|
-
|
|
119
|
-
import software.amazon.awscdk.Stack;
|
|
120
|
-
import software.amazon.awscdk.StackProps;
|
|
121
|
-
import software.amazon.awscdk.services.lambda.*;
|
|
122
|
-
import software.amazon.awscdk.services.lambda.Runtime;
|
|
123
|
-
import software.amazon.awscdk.services.iot.*;
|
|
124
|
-
import software.amazon.awscdk.services.iot.CfnTopicRule.TopicRulePayloadProperty;
|
|
125
|
-
import software.amazon.awsconstructs.services.iotlambda.*;
|
|
126
|
-
|
|
127
|
-
new IotToLambda(this, "test-iot-lambda-integration", new IotToLambdaProps.Builder()
|
|
128
|
-
.lambdaFunctionProps(new FunctionProps.Builder()
|
|
129
|
-
.runtime(Runtime.NODEJS_20_X)
|
|
130
|
-
.code(Code.fromAsset("lambda"))
|
|
131
|
-
.handler("index.handler")
|
|
132
|
-
.build())
|
|
133
|
-
.iotTopicRuleProps(new CfnTopicRuleProps.Builder()
|
|
134
|
-
.topicRulePayload(new TopicRulePayloadProperty.Builder()
|
|
135
|
-
.ruleDisabled(false)
|
|
136
|
-
.description("Processing of DTC messages from the AWS Connected Vehicle Solution.")
|
|
137
|
-
.sql("SELECT * FROM 'connectedcar/dtc/#'")
|
|
138
|
-
.actions(List.of())
|
|
139
|
-
.build())
|
|
140
|
-
.build())
|
|
141
|
-
.build());
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## Pattern Construct Props
|
|
145
|
-
|
|
146
|
-
| **Name** | **Type** | **Description** |
|
|
147
|
-
|:-------------|:----------------|-----------------|
|
|
148
|
-
|existingLambdaObj?|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.|
|
|
149
|
-
|lambdaFunctionProps?|[`lambda.FunctionProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.FunctionProps.html)|User provided props to override the default props for the Lambda function.|
|
|
150
|
-
|iotTopicRuleProps?|[`iot.CfnTopicRuleProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnTopicRuleProps.html)|User provided CfnTopicRuleProps to override the defaults|
|
|
151
|
-
|
|
152
|
-
## Pattern Properties
|
|
153
|
-
|
|
154
|
-
| **Name** | **Type** | **Description** |
|
|
155
|
-
|:-------------|:----------------|-----------------|
|
|
156
|
-
|iotTopicRule|[`iot.CfnTopicRule`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnTopicRule.html)|Returns an instance of iot.CfnTopicRule created by the construct|
|
|
157
|
-
|lambdaFunction|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Returns an instance of lambda.Function created by the construct|
|
|
158
|
-
|
|
159
|
-
## Default settings
|
|
160
|
-
|
|
161
|
-
Out of the box implementation of the Construct without any override will set the following defaults:
|
|
162
|
-
|
|
163
|
-
### Amazon IoT Rule
|
|
164
|
-
|
|
165
|
-
* Configure least privilege access IAM role for Amazon IoT
|
|
166
|
-
|
|
167
|
-
### AWS Lambda Function
|
|
168
|
-
|
|
169
|
-
* Configure limited privilege access IAM role for Lambda function
|
|
170
|
-
* Enable reusing connections with Keep-Alive for NodeJs Lambda function
|
|
171
|
-
* Enable X-Ray Tracing
|
|
172
|
-
* Set Environment Variables
|
|
173
|
-
|
|
174
|
-
* AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
|
|
175
|
-
|
|
176
|
-
## Architecture
|
|
177
|
-
|
|
178
|
-

|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|