aws-solutions-constructs.aws-kinesis-streams-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_kinesis_streams_lambda-2.85.3/PKG-INFO +28 -0
- aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3/README.md +1 -0
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/setup.py +3 -3
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/src/aws_solutions_constructs/aws_kinesis_streams_lambda/__init__.py +1 -148
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/src/aws_solutions_constructs/aws_kinesis_streams_lambda/_jsii/__init__.py +2 -2
- aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3/src/aws_solutions_constructs/aws_kinesis_streams_lambda/_jsii/aws-kinesisstreams-lambda@2.85.3.jsii.tgz +0 -0
- aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3/src/aws_solutions_constructs.aws_kinesis_streams_lambda.egg-info/PKG-INFO +28 -0
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/src/aws_solutions_constructs.aws_kinesis_streams_lambda.egg-info/SOURCES.txt +1 -1
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/src/aws_solutions_constructs.aws_kinesis_streams_lambda.egg-info/requires.txt +1 -1
- aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2/PKG-INFO +0 -175
- aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2/README.md +0 -148
- aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2/src/aws_solutions_constructs/aws_kinesis_streams_lambda/_jsii/aws-kinesisstreams-lambda@2.85.2.jsii.tgz +0 -0
- aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2/src/aws_solutions_constructs.aws_kinesis_streams_lambda.egg-info/PKG-INFO +0 -175
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/LICENSE +0 -0
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/MANIFEST.in +0 -0
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/pyproject.toml +0 -0
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/setup.cfg +0 -0
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/src/aws_solutions_constructs/aws_kinesis_streams_lambda/py.typed +0 -0
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/src/aws_solutions_constructs.aws_kinesis_streams_lambda.egg-info/dependency_links.txt +0 -0
- {aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.2 → aws_solutions_constructs_aws_kinesis_streams_lambda-2.85.3}/src/aws_solutions_constructs.aws_kinesis_streams_lambda.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: aws-solutions-constructs.aws-kinesis-streams-lambda
|
|
3
|
+
Version: 2.85.3
|
|
4
|
+
Summary: CDK constructs for defining an interaction between an Amazon Kinesis Data Stream and an AWS Lambda function.
|
|
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-kinesisstreams-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-kinesisstreams-lambda/README.adoc)
|
|
@@ -5,7 +5,7 @@ kwargs = json.loads(
|
|
|
5
5
|
"""
|
|
6
6
|
{
|
|
7
7
|
"name": "aws-solutions-constructs.aws-kinesis-streams-lambda",
|
|
8
|
-
"version": "2.85.
|
|
8
|
+
"version": "2.85.3",
|
|
9
9
|
"description": "CDK constructs for defining an interaction between an Amazon Kinesis Data Stream and an AWS Lambda function.",
|
|
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_kinesis_streams_lambda._jsii": [
|
|
29
|
-
"aws-kinesisstreams-lambda@2.85.
|
|
29
|
+
"aws-kinesisstreams-lambda@2.85.3.jsii.tgz"
|
|
30
30
|
],
|
|
31
31
|
"aws_solutions_constructs.aws_kinesis_streams_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,152 +1,5 @@
|
|
|
1
1
|
r'''
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<!--BEGIN STABILITY BANNER-->---
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-

|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
<!--END STABILITY BANNER-->
|
|
11
|
-
|
|
12
|
-
| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
|
|
13
|
-
|:-------------|:-------------|
|
|
14
|
-
|
|
15
|
-
<div style="height:8px"></div>
|
|
16
|
-
|
|
17
|
-
| **Language** | **Package** |
|
|
18
|
-
|:-------------|-----------------|
|
|
19
|
-
| Python|`aws_solutions_constructs.aws-kinesis-streams-lambda`|
|
|
20
|
-
| Typescript|`@aws-solutions-constructs/aws-kinesisstreams-lambda`|
|
|
21
|
-
| Java|`software.amazon.awsconstructs.services.kinesisstreamslambda`|
|
|
22
|
-
|
|
23
|
-
## Overview
|
|
24
|
-
|
|
25
|
-
This AWS Solutions Construct deploys a Kinesis Stream and Lambda function with the appropriate resources/properties for interaction and security.
|
|
26
|
-
|
|
27
|
-
Here is a minimal deployable pattern definition:
|
|
28
|
-
|
|
29
|
-
Typescript
|
|
30
|
-
|
|
31
|
-
```python
|
|
32
|
-
import { Construct } from 'constructs';
|
|
33
|
-
import { Stack, StackProps } from 'aws-cdk-lib';
|
|
34
|
-
import { KinesisStreamsToLambda } from '@aws-solutions-constructs/aws-kinesisstreams-lambda';
|
|
35
|
-
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
36
|
-
|
|
37
|
-
new KinesisStreamsToLambda(this, 'KinesisToLambdaPattern', {
|
|
38
|
-
kinesisEventSourceProps: {
|
|
39
|
-
startingPosition: lambda.StartingPosition.TRIM_HORIZON,
|
|
40
|
-
batchSize: 1
|
|
41
|
-
},
|
|
42
|
-
lambdaFunctionProps: {
|
|
43
|
-
runtime: lambda.Runtime.NODEJS_20_X,
|
|
44
|
-
handler: 'index.handler',
|
|
45
|
-
code: lambda.Code.fromAsset(`lambda`)
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Python
|
|
51
|
-
|
|
52
|
-
```python
|
|
53
|
-
from aws_solutions_constructs.aws_kinesis_streams_lambda import KinesisStreamsToLambda
|
|
54
|
-
from aws_cdk import (
|
|
55
|
-
aws_lambda as _lambda,
|
|
56
|
-
aws_lambda_event_sources as sources,
|
|
57
|
-
aws_kinesis as kinesis,
|
|
58
|
-
Stack
|
|
59
|
-
)
|
|
60
|
-
from constructs import Construct
|
|
61
|
-
|
|
62
|
-
KinesisStreamsToLambda(self, 'KinesisToLambdaPattern',
|
|
63
|
-
kinesis_event_source_props=sources.KinesisEventSourceProps(
|
|
64
|
-
starting_position=_lambda.StartingPosition.TRIM_HORIZON,
|
|
65
|
-
batch_size=1
|
|
66
|
-
),
|
|
67
|
-
lambda_function_props=_lambda.FunctionProps(
|
|
68
|
-
runtime=_lambda.Runtime.PYTHON_3_11,
|
|
69
|
-
handler='index.handler',
|
|
70
|
-
code=_lambda.Code.from_asset(
|
|
71
|
-
'lambda')
|
|
72
|
-
)
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Java
|
|
78
|
-
|
|
79
|
-
```java
|
|
80
|
-
import software.constructs.Construct;
|
|
81
|
-
|
|
82
|
-
import software.amazon.awscdk.Stack;
|
|
83
|
-
import software.amazon.awscdk.StackProps;
|
|
84
|
-
import software.amazon.awscdk.services.lambda.*;
|
|
85
|
-
import software.amazon.awscdk.services.lambda.eventsources.*;
|
|
86
|
-
import software.amazon.awscdk.services.lambda.Runtime;
|
|
87
|
-
import software.amazon.awsconstructs.services.kinesisstreamslambda.*;
|
|
88
|
-
|
|
89
|
-
new KinesisStreamsToLambda(this, "KinesisToLambdaPattern", new KinesisStreamsToLambdaProps.Builder()
|
|
90
|
-
.kinesisEventSourceProps(new KinesisEventSourceProps.Builder()
|
|
91
|
-
.startingPosition(StartingPosition.TRIM_HORIZON)
|
|
92
|
-
.batchSize(1)
|
|
93
|
-
.build())
|
|
94
|
-
.lambdaFunctionProps(new FunctionProps.Builder()
|
|
95
|
-
.runtime(Runtime.NODEJS_20_X)
|
|
96
|
-
.code(Code.fromAsset("lambda"))
|
|
97
|
-
.handler("index.handler")
|
|
98
|
-
.build())
|
|
99
|
-
.build());
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Pattern Construct Props
|
|
103
|
-
|
|
104
|
-
| **Name** | **Type** | **Description** |
|
|
105
|
-
|:-------------|:----------------|-----------------|
|
|
106
|
-
|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.|
|
|
107
|
-
|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.|
|
|
108
|
-
|kinesisStreamProps?|[`kinesis.StreamProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.StreamProps.html)|Optional user-provided props to override the default props for the Kinesis stream.|
|
|
109
|
-
|existingStreamObj?|[`kinesis.Stream`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.Stream.html)|Existing instance of Kinesis Stream, providing both this and `kinesisStreamProps` will cause an error.|
|
|
110
|
-
|kinesisEventSourceProps?|[`aws-lambda-event-sources.KinesisEventSourceProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_event_sources.KinesisEventSourceProps.html)|Optional user-provided props to override the default props for the Lambda event source mapping.|
|
|
111
|
-
|createCloudWatchAlarms|`boolean`|Whether to create recommended CloudWatch alarms|
|
|
112
|
-
|
|
113
|
-
## Pattern Properties
|
|
114
|
-
|
|
115
|
-
| **Name** | **Type** | **Description** |
|
|
116
|
-
|:-------------|:----------------|-----------------|
|
|
117
|
-
|kinesisStream|[`kinesis.Stream`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.Stream.html)|Returns an instance of the Kinesis stream created by the pattern.|
|
|
118
|
-
|lambdaFunction|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Returns an instance of the Lambda function created by the pattern.|
|
|
119
|
-
|kinesisStreamRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of the iam.Role created by the construct for Kinesis stream.|
|
|
120
|
-
|cloudwatchAlarms?|[`cloudwatch.Alarm[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.Alarm.html)|Returns a list of cloudwatch.Alarm created by the construct|
|
|
121
|
-
|
|
122
|
-
## Default settings
|
|
123
|
-
|
|
124
|
-
Out of the box implementation of the Construct without any override will set the following defaults:
|
|
125
|
-
|
|
126
|
-
### Amazon Kinesis Stream
|
|
127
|
-
|
|
128
|
-
* Configure least privilege access IAM role for Kinesis Stream
|
|
129
|
-
* Enable server-side encryption for Kinesis Stream using AWS Managed KMS Key
|
|
130
|
-
* Deploy best practices CloudWatch Alarms for the Kinesis Stream
|
|
131
|
-
|
|
132
|
-
### AWS Lambda Function
|
|
133
|
-
|
|
134
|
-
* Configure limited privilege access IAM role for Lambda function
|
|
135
|
-
* Enable reusing connections with Keep-Alive for NodeJs Lambda function
|
|
136
|
-
* Enable X-Ray Tracing
|
|
137
|
-
* Enable Failure-Handling features like enable bisect on function Error, set defaults for Maximum Record Age (24 hours) & Maximum Retry Attempts (500) and deploy SQS dead-letter queue as destination on failure
|
|
138
|
-
* Set Environment Variables
|
|
139
|
-
|
|
140
|
-
* AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
|
|
141
|
-
|
|
142
|
-
## Architecture
|
|
143
|
-
|
|
144
|
-

|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
© 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-kinesisstreams-lambda/README.adoc)
|
|
150
3
|
'''
|
|
151
4
|
from pkgutil import extend_path
|
|
152
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-kinesisstreams-lambda",
|
|
37
|
-
"2.85.
|
|
37
|
+
"2.85.3",
|
|
38
38
|
__name__[0:-6],
|
|
39
|
-
"aws-kinesisstreams-lambda@2.85.
|
|
39
|
+
"aws-kinesisstreams-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-kinesis-streams-lambda
|
|
3
|
+
Version: 2.85.3
|
|
4
|
+
Summary: CDK constructs for defining an interaction between an Amazon Kinesis Data Stream and an AWS Lambda function.
|
|
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-kinesisstreams-lambda/README.adoc)
|
|
@@ -11,4 +11,4 @@ src/aws_solutions_constructs.aws_kinesis_streams_lambda.egg-info/top_level.txt
|
|
|
11
11
|
src/aws_solutions_constructs/aws_kinesis_streams_lambda/__init__.py
|
|
12
12
|
src/aws_solutions_constructs/aws_kinesis_streams_lambda/py.typed
|
|
13
13
|
src/aws_solutions_constructs/aws_kinesis_streams_lambda/_jsii/__init__.py
|
|
14
|
-
src/aws_solutions_constructs/aws_kinesis_streams_lambda/_jsii/aws-kinesisstreams-lambda@2.85.
|
|
14
|
+
src/aws_solutions_constructs/aws_kinesis_streams_lambda/_jsii/aws-kinesisstreams-lambda@2.85.3.jsii.tgz
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: aws-solutions-constructs.aws-kinesis-streams-lambda
|
|
3
|
-
Version: 2.85.2
|
|
4
|
-
Summary: CDK constructs for defining an interaction between an Amazon Kinesis Data Stream and an AWS Lambda function.
|
|
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-kinesisstreams-lambda module
|
|
29
|
-
|
|
30
|
-
<!--BEGIN STABILITY BANNER-->---
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-

|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
<!--END STABILITY BANNER-->
|
|
37
|
-
|
|
38
|
-
| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
|
|
39
|
-
|:-------------|:-------------|
|
|
40
|
-
|
|
41
|
-
<div style="height:8px"></div>
|
|
42
|
-
|
|
43
|
-
| **Language** | **Package** |
|
|
44
|
-
|:-------------|-----------------|
|
|
45
|
-
| Python|`aws_solutions_constructs.aws-kinesis-streams-lambda`|
|
|
46
|
-
| Typescript|`@aws-solutions-constructs/aws-kinesisstreams-lambda`|
|
|
47
|
-
| Java|`software.amazon.awsconstructs.services.kinesisstreamslambda`|
|
|
48
|
-
|
|
49
|
-
## Overview
|
|
50
|
-
|
|
51
|
-
This AWS Solutions Construct deploys a Kinesis Stream and Lambda function with the appropriate resources/properties for interaction and security.
|
|
52
|
-
|
|
53
|
-
Here is a minimal deployable pattern definition:
|
|
54
|
-
|
|
55
|
-
Typescript
|
|
56
|
-
|
|
57
|
-
```python
|
|
58
|
-
import { Construct } from 'constructs';
|
|
59
|
-
import { Stack, StackProps } from 'aws-cdk-lib';
|
|
60
|
-
import { KinesisStreamsToLambda } from '@aws-solutions-constructs/aws-kinesisstreams-lambda';
|
|
61
|
-
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
62
|
-
|
|
63
|
-
new KinesisStreamsToLambda(this, 'KinesisToLambdaPattern', {
|
|
64
|
-
kinesisEventSourceProps: {
|
|
65
|
-
startingPosition: lambda.StartingPosition.TRIM_HORIZON,
|
|
66
|
-
batchSize: 1
|
|
67
|
-
},
|
|
68
|
-
lambdaFunctionProps: {
|
|
69
|
-
runtime: lambda.Runtime.NODEJS_20_X,
|
|
70
|
-
handler: 'index.handler',
|
|
71
|
-
code: lambda.Code.fromAsset(`lambda`)
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Python
|
|
77
|
-
|
|
78
|
-
```python
|
|
79
|
-
from aws_solutions_constructs.aws_kinesis_streams_lambda import KinesisStreamsToLambda
|
|
80
|
-
from aws_cdk import (
|
|
81
|
-
aws_lambda as _lambda,
|
|
82
|
-
aws_lambda_event_sources as sources,
|
|
83
|
-
aws_kinesis as kinesis,
|
|
84
|
-
Stack
|
|
85
|
-
)
|
|
86
|
-
from constructs import Construct
|
|
87
|
-
|
|
88
|
-
KinesisStreamsToLambda(self, 'KinesisToLambdaPattern',
|
|
89
|
-
kinesis_event_source_props=sources.KinesisEventSourceProps(
|
|
90
|
-
starting_position=_lambda.StartingPosition.TRIM_HORIZON,
|
|
91
|
-
batch_size=1
|
|
92
|
-
),
|
|
93
|
-
lambda_function_props=_lambda.FunctionProps(
|
|
94
|
-
runtime=_lambda.Runtime.PYTHON_3_11,
|
|
95
|
-
handler='index.handler',
|
|
96
|
-
code=_lambda.Code.from_asset(
|
|
97
|
-
'lambda')
|
|
98
|
-
)
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Java
|
|
104
|
-
|
|
105
|
-
```java
|
|
106
|
-
import software.constructs.Construct;
|
|
107
|
-
|
|
108
|
-
import software.amazon.awscdk.Stack;
|
|
109
|
-
import software.amazon.awscdk.StackProps;
|
|
110
|
-
import software.amazon.awscdk.services.lambda.*;
|
|
111
|
-
import software.amazon.awscdk.services.lambda.eventsources.*;
|
|
112
|
-
import software.amazon.awscdk.services.lambda.Runtime;
|
|
113
|
-
import software.amazon.awsconstructs.services.kinesisstreamslambda.*;
|
|
114
|
-
|
|
115
|
-
new KinesisStreamsToLambda(this, "KinesisToLambdaPattern", new KinesisStreamsToLambdaProps.Builder()
|
|
116
|
-
.kinesisEventSourceProps(new KinesisEventSourceProps.Builder()
|
|
117
|
-
.startingPosition(StartingPosition.TRIM_HORIZON)
|
|
118
|
-
.batchSize(1)
|
|
119
|
-
.build())
|
|
120
|
-
.lambdaFunctionProps(new FunctionProps.Builder()
|
|
121
|
-
.runtime(Runtime.NODEJS_20_X)
|
|
122
|
-
.code(Code.fromAsset("lambda"))
|
|
123
|
-
.handler("index.handler")
|
|
124
|
-
.build())
|
|
125
|
-
.build());
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Pattern Construct Props
|
|
129
|
-
|
|
130
|
-
| **Name** | **Type** | **Description** |
|
|
131
|
-
|:-------------|:----------------|-----------------|
|
|
132
|
-
|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.|
|
|
133
|
-
|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.|
|
|
134
|
-
|kinesisStreamProps?|[`kinesis.StreamProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.StreamProps.html)|Optional user-provided props to override the default props for the Kinesis stream.|
|
|
135
|
-
|existingStreamObj?|[`kinesis.Stream`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.Stream.html)|Existing instance of Kinesis Stream, providing both this and `kinesisStreamProps` will cause an error.|
|
|
136
|
-
|kinesisEventSourceProps?|[`aws-lambda-event-sources.KinesisEventSourceProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_event_sources.KinesisEventSourceProps.html)|Optional user-provided props to override the default props for the Lambda event source mapping.|
|
|
137
|
-
|createCloudWatchAlarms|`boolean`|Whether to create recommended CloudWatch alarms|
|
|
138
|
-
|
|
139
|
-
## Pattern Properties
|
|
140
|
-
|
|
141
|
-
| **Name** | **Type** | **Description** |
|
|
142
|
-
|:-------------|:----------------|-----------------|
|
|
143
|
-
|kinesisStream|[`kinesis.Stream`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.Stream.html)|Returns an instance of the Kinesis stream created by the pattern.|
|
|
144
|
-
|lambdaFunction|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Returns an instance of the Lambda function created by the pattern.|
|
|
145
|
-
|kinesisStreamRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of the iam.Role created by the construct for Kinesis stream.|
|
|
146
|
-
|cloudwatchAlarms?|[`cloudwatch.Alarm[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.Alarm.html)|Returns a list of cloudwatch.Alarm created by the construct|
|
|
147
|
-
|
|
148
|
-
## Default settings
|
|
149
|
-
|
|
150
|
-
Out of the box implementation of the Construct without any override will set the following defaults:
|
|
151
|
-
|
|
152
|
-
### Amazon Kinesis Stream
|
|
153
|
-
|
|
154
|
-
* Configure least privilege access IAM role for Kinesis Stream
|
|
155
|
-
* Enable server-side encryption for Kinesis Stream using AWS Managed KMS Key
|
|
156
|
-
* Deploy best practices CloudWatch Alarms for the Kinesis Stream
|
|
157
|
-
|
|
158
|
-
### AWS Lambda Function
|
|
159
|
-
|
|
160
|
-
* Configure limited privilege access IAM role for Lambda function
|
|
161
|
-
* Enable reusing connections with Keep-Alive for NodeJs Lambda function
|
|
162
|
-
* Enable X-Ray Tracing
|
|
163
|
-
* Enable Failure-Handling features like enable bisect on function Error, set defaults for Maximum Record Age (24 hours) & Maximum Retry Attempts (500) and deploy SQS dead-letter queue as destination on failure
|
|
164
|
-
* Set Environment Variables
|
|
165
|
-
|
|
166
|
-
* AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
|
|
167
|
-
|
|
168
|
-
## Architecture
|
|
169
|
-
|
|
170
|
-

|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
# aws-kinesisstreams-lambda module
|
|
2
|
-
|
|
3
|
-
<!--BEGIN STABILITY BANNER-->---
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
<!--END STABILITY BANNER-->
|
|
10
|
-
|
|
11
|
-
| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
|
|
12
|
-
|:-------------|:-------------|
|
|
13
|
-
|
|
14
|
-
<div style="height:8px"></div>
|
|
15
|
-
|
|
16
|
-
| **Language** | **Package** |
|
|
17
|
-
|:-------------|-----------------|
|
|
18
|
-
| Python|`aws_solutions_constructs.aws-kinesis-streams-lambda`|
|
|
19
|
-
| Typescript|`@aws-solutions-constructs/aws-kinesisstreams-lambda`|
|
|
20
|
-
| Java|`software.amazon.awsconstructs.services.kinesisstreamslambda`|
|
|
21
|
-
|
|
22
|
-
## Overview
|
|
23
|
-
|
|
24
|
-
This AWS Solutions Construct deploys a Kinesis Stream and Lambda function with the appropriate resources/properties for interaction and security.
|
|
25
|
-
|
|
26
|
-
Here is a minimal deployable pattern definition:
|
|
27
|
-
|
|
28
|
-
Typescript
|
|
29
|
-
|
|
30
|
-
```python
|
|
31
|
-
import { Construct } from 'constructs';
|
|
32
|
-
import { Stack, StackProps } from 'aws-cdk-lib';
|
|
33
|
-
import { KinesisStreamsToLambda } from '@aws-solutions-constructs/aws-kinesisstreams-lambda';
|
|
34
|
-
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
35
|
-
|
|
36
|
-
new KinesisStreamsToLambda(this, 'KinesisToLambdaPattern', {
|
|
37
|
-
kinesisEventSourceProps: {
|
|
38
|
-
startingPosition: lambda.StartingPosition.TRIM_HORIZON,
|
|
39
|
-
batchSize: 1
|
|
40
|
-
},
|
|
41
|
-
lambdaFunctionProps: {
|
|
42
|
-
runtime: lambda.Runtime.NODEJS_20_X,
|
|
43
|
-
handler: 'index.handler',
|
|
44
|
-
code: lambda.Code.fromAsset(`lambda`)
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Python
|
|
50
|
-
|
|
51
|
-
```python
|
|
52
|
-
from aws_solutions_constructs.aws_kinesis_streams_lambda import KinesisStreamsToLambda
|
|
53
|
-
from aws_cdk import (
|
|
54
|
-
aws_lambda as _lambda,
|
|
55
|
-
aws_lambda_event_sources as sources,
|
|
56
|
-
aws_kinesis as kinesis,
|
|
57
|
-
Stack
|
|
58
|
-
)
|
|
59
|
-
from constructs import Construct
|
|
60
|
-
|
|
61
|
-
KinesisStreamsToLambda(self, 'KinesisToLambdaPattern',
|
|
62
|
-
kinesis_event_source_props=sources.KinesisEventSourceProps(
|
|
63
|
-
starting_position=_lambda.StartingPosition.TRIM_HORIZON,
|
|
64
|
-
batch_size=1
|
|
65
|
-
),
|
|
66
|
-
lambda_function_props=_lambda.FunctionProps(
|
|
67
|
-
runtime=_lambda.Runtime.PYTHON_3_11,
|
|
68
|
-
handler='index.handler',
|
|
69
|
-
code=_lambda.Code.from_asset(
|
|
70
|
-
'lambda')
|
|
71
|
-
)
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Java
|
|
77
|
-
|
|
78
|
-
```java
|
|
79
|
-
import software.constructs.Construct;
|
|
80
|
-
|
|
81
|
-
import software.amazon.awscdk.Stack;
|
|
82
|
-
import software.amazon.awscdk.StackProps;
|
|
83
|
-
import software.amazon.awscdk.services.lambda.*;
|
|
84
|
-
import software.amazon.awscdk.services.lambda.eventsources.*;
|
|
85
|
-
import software.amazon.awscdk.services.lambda.Runtime;
|
|
86
|
-
import software.amazon.awsconstructs.services.kinesisstreamslambda.*;
|
|
87
|
-
|
|
88
|
-
new KinesisStreamsToLambda(this, "KinesisToLambdaPattern", new KinesisStreamsToLambdaProps.Builder()
|
|
89
|
-
.kinesisEventSourceProps(new KinesisEventSourceProps.Builder()
|
|
90
|
-
.startingPosition(StartingPosition.TRIM_HORIZON)
|
|
91
|
-
.batchSize(1)
|
|
92
|
-
.build())
|
|
93
|
-
.lambdaFunctionProps(new FunctionProps.Builder()
|
|
94
|
-
.runtime(Runtime.NODEJS_20_X)
|
|
95
|
-
.code(Code.fromAsset("lambda"))
|
|
96
|
-
.handler("index.handler")
|
|
97
|
-
.build())
|
|
98
|
-
.build());
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Pattern Construct Props
|
|
102
|
-
|
|
103
|
-
| **Name** | **Type** | **Description** |
|
|
104
|
-
|:-------------|:----------------|-----------------|
|
|
105
|
-
|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.|
|
|
106
|
-
|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.|
|
|
107
|
-
|kinesisStreamProps?|[`kinesis.StreamProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.StreamProps.html)|Optional user-provided props to override the default props for the Kinesis stream.|
|
|
108
|
-
|existingStreamObj?|[`kinesis.Stream`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.Stream.html)|Existing instance of Kinesis Stream, providing both this and `kinesisStreamProps` will cause an error.|
|
|
109
|
-
|kinesisEventSourceProps?|[`aws-lambda-event-sources.KinesisEventSourceProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_event_sources.KinesisEventSourceProps.html)|Optional user-provided props to override the default props for the Lambda event source mapping.|
|
|
110
|
-
|createCloudWatchAlarms|`boolean`|Whether to create recommended CloudWatch alarms|
|
|
111
|
-
|
|
112
|
-
## Pattern Properties
|
|
113
|
-
|
|
114
|
-
| **Name** | **Type** | **Description** |
|
|
115
|
-
|:-------------|:----------------|-----------------|
|
|
116
|
-
|kinesisStream|[`kinesis.Stream`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.Stream.html)|Returns an instance of the Kinesis stream created by the pattern.|
|
|
117
|
-
|lambdaFunction|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Returns an instance of the Lambda function created by the pattern.|
|
|
118
|
-
|kinesisStreamRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of the iam.Role created by the construct for Kinesis stream.|
|
|
119
|
-
|cloudwatchAlarms?|[`cloudwatch.Alarm[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.Alarm.html)|Returns a list of cloudwatch.Alarm created by the construct|
|
|
120
|
-
|
|
121
|
-
## Default settings
|
|
122
|
-
|
|
123
|
-
Out of the box implementation of the Construct without any override will set the following defaults:
|
|
124
|
-
|
|
125
|
-
### Amazon Kinesis Stream
|
|
126
|
-
|
|
127
|
-
* Configure least privilege access IAM role for Kinesis Stream
|
|
128
|
-
* Enable server-side encryption for Kinesis Stream using AWS Managed KMS Key
|
|
129
|
-
* Deploy best practices CloudWatch Alarms for the Kinesis Stream
|
|
130
|
-
|
|
131
|
-
### AWS Lambda Function
|
|
132
|
-
|
|
133
|
-
* Configure limited privilege access IAM role for Lambda function
|
|
134
|
-
* Enable reusing connections with Keep-Alive for NodeJs Lambda function
|
|
135
|
-
* Enable X-Ray Tracing
|
|
136
|
-
* Enable Failure-Handling features like enable bisect on function Error, set defaults for Maximum Record Age (24 hours) & Maximum Retry Attempts (500) and deploy SQS dead-letter queue as destination on failure
|
|
137
|
-
* Set Environment Variables
|
|
138
|
-
|
|
139
|
-
* AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
|
|
140
|
-
|
|
141
|
-
## Architecture
|
|
142
|
-
|
|
143
|
-

|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
Binary file
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: aws-solutions-constructs.aws-kinesis-streams-lambda
|
|
3
|
-
Version: 2.85.2
|
|
4
|
-
Summary: CDK constructs for defining an interaction between an Amazon Kinesis Data Stream and an AWS Lambda function.
|
|
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-kinesisstreams-lambda module
|
|
29
|
-
|
|
30
|
-
<!--BEGIN STABILITY BANNER-->---
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-

|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
<!--END STABILITY BANNER-->
|
|
37
|
-
|
|
38
|
-
| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
|
|
39
|
-
|:-------------|:-------------|
|
|
40
|
-
|
|
41
|
-
<div style="height:8px"></div>
|
|
42
|
-
|
|
43
|
-
| **Language** | **Package** |
|
|
44
|
-
|:-------------|-----------------|
|
|
45
|
-
| Python|`aws_solutions_constructs.aws-kinesis-streams-lambda`|
|
|
46
|
-
| Typescript|`@aws-solutions-constructs/aws-kinesisstreams-lambda`|
|
|
47
|
-
| Java|`software.amazon.awsconstructs.services.kinesisstreamslambda`|
|
|
48
|
-
|
|
49
|
-
## Overview
|
|
50
|
-
|
|
51
|
-
This AWS Solutions Construct deploys a Kinesis Stream and Lambda function with the appropriate resources/properties for interaction and security.
|
|
52
|
-
|
|
53
|
-
Here is a minimal deployable pattern definition:
|
|
54
|
-
|
|
55
|
-
Typescript
|
|
56
|
-
|
|
57
|
-
```python
|
|
58
|
-
import { Construct } from 'constructs';
|
|
59
|
-
import { Stack, StackProps } from 'aws-cdk-lib';
|
|
60
|
-
import { KinesisStreamsToLambda } from '@aws-solutions-constructs/aws-kinesisstreams-lambda';
|
|
61
|
-
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
62
|
-
|
|
63
|
-
new KinesisStreamsToLambda(this, 'KinesisToLambdaPattern', {
|
|
64
|
-
kinesisEventSourceProps: {
|
|
65
|
-
startingPosition: lambda.StartingPosition.TRIM_HORIZON,
|
|
66
|
-
batchSize: 1
|
|
67
|
-
},
|
|
68
|
-
lambdaFunctionProps: {
|
|
69
|
-
runtime: lambda.Runtime.NODEJS_20_X,
|
|
70
|
-
handler: 'index.handler',
|
|
71
|
-
code: lambda.Code.fromAsset(`lambda`)
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Python
|
|
77
|
-
|
|
78
|
-
```python
|
|
79
|
-
from aws_solutions_constructs.aws_kinesis_streams_lambda import KinesisStreamsToLambda
|
|
80
|
-
from aws_cdk import (
|
|
81
|
-
aws_lambda as _lambda,
|
|
82
|
-
aws_lambda_event_sources as sources,
|
|
83
|
-
aws_kinesis as kinesis,
|
|
84
|
-
Stack
|
|
85
|
-
)
|
|
86
|
-
from constructs import Construct
|
|
87
|
-
|
|
88
|
-
KinesisStreamsToLambda(self, 'KinesisToLambdaPattern',
|
|
89
|
-
kinesis_event_source_props=sources.KinesisEventSourceProps(
|
|
90
|
-
starting_position=_lambda.StartingPosition.TRIM_HORIZON,
|
|
91
|
-
batch_size=1
|
|
92
|
-
),
|
|
93
|
-
lambda_function_props=_lambda.FunctionProps(
|
|
94
|
-
runtime=_lambda.Runtime.PYTHON_3_11,
|
|
95
|
-
handler='index.handler',
|
|
96
|
-
code=_lambda.Code.from_asset(
|
|
97
|
-
'lambda')
|
|
98
|
-
)
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Java
|
|
104
|
-
|
|
105
|
-
```java
|
|
106
|
-
import software.constructs.Construct;
|
|
107
|
-
|
|
108
|
-
import software.amazon.awscdk.Stack;
|
|
109
|
-
import software.amazon.awscdk.StackProps;
|
|
110
|
-
import software.amazon.awscdk.services.lambda.*;
|
|
111
|
-
import software.amazon.awscdk.services.lambda.eventsources.*;
|
|
112
|
-
import software.amazon.awscdk.services.lambda.Runtime;
|
|
113
|
-
import software.amazon.awsconstructs.services.kinesisstreamslambda.*;
|
|
114
|
-
|
|
115
|
-
new KinesisStreamsToLambda(this, "KinesisToLambdaPattern", new KinesisStreamsToLambdaProps.Builder()
|
|
116
|
-
.kinesisEventSourceProps(new KinesisEventSourceProps.Builder()
|
|
117
|
-
.startingPosition(StartingPosition.TRIM_HORIZON)
|
|
118
|
-
.batchSize(1)
|
|
119
|
-
.build())
|
|
120
|
-
.lambdaFunctionProps(new FunctionProps.Builder()
|
|
121
|
-
.runtime(Runtime.NODEJS_20_X)
|
|
122
|
-
.code(Code.fromAsset("lambda"))
|
|
123
|
-
.handler("index.handler")
|
|
124
|
-
.build())
|
|
125
|
-
.build());
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Pattern Construct Props
|
|
129
|
-
|
|
130
|
-
| **Name** | **Type** | **Description** |
|
|
131
|
-
|:-------------|:----------------|-----------------|
|
|
132
|
-
|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.|
|
|
133
|
-
|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.|
|
|
134
|
-
|kinesisStreamProps?|[`kinesis.StreamProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.StreamProps.html)|Optional user-provided props to override the default props for the Kinesis stream.|
|
|
135
|
-
|existingStreamObj?|[`kinesis.Stream`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.Stream.html)|Existing instance of Kinesis Stream, providing both this and `kinesisStreamProps` will cause an error.|
|
|
136
|
-
|kinesisEventSourceProps?|[`aws-lambda-event-sources.KinesisEventSourceProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_event_sources.KinesisEventSourceProps.html)|Optional user-provided props to override the default props for the Lambda event source mapping.|
|
|
137
|
-
|createCloudWatchAlarms|`boolean`|Whether to create recommended CloudWatch alarms|
|
|
138
|
-
|
|
139
|
-
## Pattern Properties
|
|
140
|
-
|
|
141
|
-
| **Name** | **Type** | **Description** |
|
|
142
|
-
|:-------------|:----------------|-----------------|
|
|
143
|
-
|kinesisStream|[`kinesis.Stream`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.Stream.html)|Returns an instance of the Kinesis stream created by the pattern.|
|
|
144
|
-
|lambdaFunction|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Returns an instance of the Lambda function created by the pattern.|
|
|
145
|
-
|kinesisStreamRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of the iam.Role created by the construct for Kinesis stream.|
|
|
146
|
-
|cloudwatchAlarms?|[`cloudwatch.Alarm[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.Alarm.html)|Returns a list of cloudwatch.Alarm created by the construct|
|
|
147
|
-
|
|
148
|
-
## Default settings
|
|
149
|
-
|
|
150
|
-
Out of the box implementation of the Construct without any override will set the following defaults:
|
|
151
|
-
|
|
152
|
-
### Amazon Kinesis Stream
|
|
153
|
-
|
|
154
|
-
* Configure least privilege access IAM role for Kinesis Stream
|
|
155
|
-
* Enable server-side encryption for Kinesis Stream using AWS Managed KMS Key
|
|
156
|
-
* Deploy best practices CloudWatch Alarms for the Kinesis Stream
|
|
157
|
-
|
|
158
|
-
### AWS Lambda Function
|
|
159
|
-
|
|
160
|
-
* Configure limited privilege access IAM role for Lambda function
|
|
161
|
-
* Enable reusing connections with Keep-Alive for NodeJs Lambda function
|
|
162
|
-
* Enable X-Ray Tracing
|
|
163
|
-
* Enable Failure-Handling features like enable bisect on function Error, set defaults for Maximum Record Age (24 hours) & Maximum Retry Attempts (500) and deploy SQS dead-letter queue as destination on failure
|
|
164
|
-
* Set Environment Variables
|
|
165
|
-
|
|
166
|
-
* AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
|
|
167
|
-
|
|
168
|
-
## Architecture
|
|
169
|
-
|
|
170
|
-

|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
© 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
|