aws-solutions-constructs.aws-lambda-opensearch 2.85.2__py3-none-any.whl → 2.85.3__py3-none-any.whl
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_lambda_opensearch/__init__.py +1 -170
- aws_solutions_constructs/aws_lambda_opensearch/_jsii/__init__.py +2 -2
- aws_solutions_constructs/aws_lambda_opensearch/_jsii/aws-lambda-opensearch@2.85.3.jsii.tgz +0 -0
- aws_solutions_constructs_aws_lambda_opensearch-2.85.3.dist-info/METADATA +28 -0
- aws_solutions_constructs_aws_lambda_opensearch-2.85.3.dist-info/RECORD +9 -0
- aws_solutions_constructs/aws_lambda_opensearch/_jsii/aws-lambda-opensearch@2.85.2.jsii.tgz +0 -0
- aws_solutions_constructs_aws_lambda_opensearch-2.85.2.dist-info/METADATA +0 -197
- aws_solutions_constructs_aws_lambda_opensearch-2.85.2.dist-info/RECORD +0 -9
- {aws_solutions_constructs_aws_lambda_opensearch-2.85.2.dist-info → aws_solutions_constructs_aws_lambda_opensearch-2.85.3.dist-info}/LICENSE +0 -0
- {aws_solutions_constructs_aws_lambda_opensearch-2.85.2.dist-info → aws_solutions_constructs_aws_lambda_opensearch-2.85.3.dist-info}/WHEEL +0 -0
- {aws_solutions_constructs_aws_lambda_opensearch-2.85.2.dist-info → aws_solutions_constructs_aws_lambda_opensearch-2.85.3.dist-info}/top_level.txt +0 -0
@@ -1,174 +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_lambda_opensearch`|
|
24
|
-
| Typescript|`@aws-solutions-constructs/aws-lambda-opensearch`|
|
25
|
-
| Java|`software.amazon.awsconstructs.services.lambdaopensearch`|
|
26
|
-
|
27
|
-
## Overview
|
28
|
-
|
29
|
-
This AWS Solutions Construct implements an AWS Lambda function and Amazon OpenSearch Service with the least privileged permissions.
|
30
|
-
|
31
|
-
Here is a minimal deployable pattern definition:
|
32
|
-
|
33
|
-
Typescript
|
34
|
-
|
35
|
-
```python
|
36
|
-
import { Construct } from 'constructs';
|
37
|
-
import { Stack, StackProps, Aws } from 'aws-cdk-lib';
|
38
|
-
import { LambdaToOpenSearch } from '@aws-solutions-constructs/aws-lambda-opensearch';
|
39
|
-
import * as lambda from "aws-cdk-lib/aws-lambda";
|
40
|
-
|
41
|
-
const lambdaProps: lambda.FunctionProps = {
|
42
|
-
code: lambda.Code.fromAsset(`lambda`),
|
43
|
-
runtime: lambda.Runtime.NODEJS_20_X,
|
44
|
-
handler: 'index.handler'
|
45
|
-
};
|
46
|
-
|
47
|
-
new LambdaToOpenSearch(this, 'sample', {
|
48
|
-
lambdaFunctionProps: lambdaProps,
|
49
|
-
openSearchDomainName: 'testdomain',
|
50
|
-
// TODO: Ensure the Cognito domain name is globally unique
|
51
|
-
cognitoDomainName: 'globallyuniquedomain' + Aws.ACCOUNT_ID
|
52
|
-
});
|
53
|
-
```
|
54
|
-
|
55
|
-
Python
|
56
|
-
|
57
|
-
```python
|
58
|
-
from aws_solutions_constructs.aws_lambda_opensearch import LambdaToOpenSearch
|
59
|
-
from aws_cdk import (
|
60
|
-
aws_lambda as _lambda,
|
61
|
-
Aws,
|
62
|
-
Stack
|
63
|
-
)
|
64
|
-
from constructs import Construct
|
65
|
-
|
66
|
-
lambda_props = _lambda.FunctionProps(
|
67
|
-
code=_lambda.Code.from_asset('lambda'),
|
68
|
-
runtime=_lambda.Runtime.PYTHON_3_11,
|
69
|
-
handler='index.handler'
|
70
|
-
)
|
71
|
-
|
72
|
-
LambdaToOpenSearch(self, 'sample',
|
73
|
-
lambda_function_props=lambda_props,
|
74
|
-
open_search_domain_name='testdomain',
|
75
|
-
# TODO: Ensure the Cognito domain name is globally unique
|
76
|
-
cognito_domain_name='globallyuniquedomain' + Aws.ACCOUNT_ID
|
77
|
-
)
|
78
|
-
```
|
79
|
-
|
80
|
-
Java
|
81
|
-
|
82
|
-
```java
|
83
|
-
import software.constructs.Construct;
|
84
|
-
|
85
|
-
import software.amazon.awscdk.Stack;
|
86
|
-
import software.amazon.awscdk.StackProps;
|
87
|
-
import software.amazon.awscdk.Aws;
|
88
|
-
import software.amazon.awscdk.services.lambda.*;
|
89
|
-
import software.amazon.awscdk.services.lambda.Runtime;
|
90
|
-
import software.amazon.awsconstructs.services.lambdaopensearch.*;
|
91
|
-
|
92
|
-
new LambdaToOpenSearch(this, "sample",
|
93
|
-
new LambdaToOpenSearchProps.Builder()
|
94
|
-
.lambdaFunctionProps(new FunctionProps.Builder()
|
95
|
-
.runtime(Runtime.NODEJS_20_X)
|
96
|
-
.code(Code.fromAsset("lambda"))
|
97
|
-
.handler("index.handler")
|
98
|
-
.build())
|
99
|
-
.openSearchDomainName("testdomain")
|
100
|
-
// TODO: Ensure the Cognito domain name is globally unique
|
101
|
-
.cognitoDomainName("globallyuniquedomain" + Aws.ACCOUNT_ID)
|
102
|
-
.build());
|
103
|
-
```
|
104
|
-
|
105
|
-
## Pattern Construct Props
|
106
|
-
|
107
|
-
| **Name** | **Type** | **Description** |
|
108
|
-
|:-------------|:----------------|-----------------|
|
109
|
-
|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.|
|
110
|
-
|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.|
|
111
|
-
|openSearchDomainProps?|[`opensearchservice.CfnDomainProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_opensearchservice.CfnDomainProps.html)|Optional user provided props to override the default props for the OpenSearch Service.|
|
112
|
-
|openSearchDomainName|`string`|Domain name for the OpenSearch Service.|
|
113
|
-
|cognitoDomainName?|`string`|Optional Amazon Cognito domain name. If omitted the Amazon Cognito domain will default to the OpenSearch Service domain name.|
|
114
|
-
|createCloudWatchAlarms?|`boolean`|Whether to create the recommended CloudWatch alarms.|
|
115
|
-
|domainEndpointEnvironmentVariableName?|`string`|Optional name for the OpenSearch domain endpoint environment variable set for the Lambda function. Default is `DOMAIN_ENDPOINT`.|
|
116
|
-
|existingVpc?|[`ec2.IVpc`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html)|An optional, existing VPC into which this pattern should be deployed. When deployed in a VPC, the Lambda function will use ENIs in the VPC to access network resources. If an existing VPC is provided, the `deployVpc` property cannot be `true`. This uses `ec2.IVpc` to allow clients to supply VPCs that exist outside the stack using the [`ec2.Vpc.fromLookup()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Vpc.html#static-fromwbrlookupscope-id-options) method.|
|
117
|
-
|vpcProps?|[`ec2.VpcProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.VpcProps.html)|Optional user provided properties to override the default properties for the new VPC. `enableDnsHostnames`, `enableDnsSupport`, `natGateways` and `subnetConfiguration` are set by the pattern, so any values for those properties supplied here will be overridden. If `deployVpc` is not `true` then this property will be ignored.|
|
118
|
-
|deployVpc?|`boolean`|Whether to create a new VPC based on `vpcProps` into which to deploy this pattern. Setting this to true will deploy the minimal, most private VPC to run the pattern:<ul><li> One isolated subnet in each Availability Zone used by the CDK program</li><li>`enableDnsHostnames` and `enableDnsSupport` will both be set to true</li></ul>If this property is `true` then `existingVpc` cannot be specified. Defaults to `false`.|
|
119
|
-
|
120
|
-
## Pattern Properties
|
121
|
-
|
122
|
-
| **Name** | **Type** | **Description** |
|
123
|
-
|:-------------|:----------------|-----------------|
|
124
|
-
|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|
|
125
|
-
|userPool|[`cognito.UserPool`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPool.html)|Returns an instance of `cognito.UserPool` created by the construct|
|
126
|
-
|userPoolClient|[`cognito.UserPoolClient`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPoolClient.html)|Returns an instance of `cognito.UserPoolClient` created by the construct|
|
127
|
-
|identityPool|[`cognito.CfnIdentityPool`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.CfnIdentityPool.html)|Returns an instance of `cognito.CfnIdentityPool` created by the construct|
|
128
|
-
|openSearchDomain|[`opensearchservice.CfnDomain`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_opensearchservice.CfnDomain.html)|Returns an instance of `opensearch.CfnDomain` created by the construct|
|
129
|
-
|openSearchRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of `iam.Role` created by the construct for `opensearch.CfnDomain`|
|
130
|
-
|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|
|
131
|
-
|vpc?|[`ec2.IVpc`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html)|Returns an interface on the VPC used by the pattern (if any). This may be a VPC created by the pattern or the VPC supplied to the pattern constructor.|
|
132
|
-
|
133
|
-
## Lambda Function
|
134
|
-
|
135
|
-
This pattern requires a lambda function that can post data into the OpenSearch. A sample function is provided [here](https://github.com/awslabs/aws-solutions-constructs/blob/master/source/patterns/%40aws-solutions-constructs/aws-lambda-opensearch/test/lambda/index.js).
|
136
|
-
|
137
|
-
## Default settings
|
138
|
-
|
139
|
-
Out of the box implementation of the Construct without any overrides will set the following defaults:
|
140
|
-
|
141
|
-
### AWS Lambda Function
|
142
|
-
|
143
|
-
* Configure limited privilege access IAM role for Lambda function
|
144
|
-
* Enable reusing connections with Keep-Alive for Node.js Lambda function
|
145
|
-
* Enable X-Ray Tracing
|
146
|
-
* Set Environment Variables
|
147
|
-
|
148
|
-
* (default) DOMAIN_ENDPOINT
|
149
|
-
* AWS_NODEJS_CONNECTION_REUSE_ENABLED
|
150
|
-
|
151
|
-
### Amazon Cognito
|
152
|
-
|
153
|
-
* Set password policy for User Pools
|
154
|
-
* Enforce the advanced security mode for User Pools
|
155
|
-
|
156
|
-
### Amazon OpenSearch Service
|
157
|
-
|
158
|
-
* Deploy best practices CloudWatch Alarms for the OpenSearch Service domain
|
159
|
-
* Secure the OpenSearch Service dashboard access with Cognito User Pools
|
160
|
-
* Enable server-side encryption for OpenSearch Service domain using AWS managed KMS Key
|
161
|
-
* Enable node-to-node encryption for the OpenSearch Service domain
|
162
|
-
* Configure the cluster for the OpenSearch Service domain
|
163
|
-
|
164
|
-
## Architecture
|
165
|
-
|
166
|
-

|
167
|
-
|
168
|
-
---
|
169
|
-
|
170
|
-
|
171
|
-
© 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-lambda-opensearch/README.adoc)
|
172
3
|
'''
|
173
4
|
from pkgutil import extend_path
|
174
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-lambda-opensearch",
|
37
|
-
"2.85.
|
37
|
+
"2.85.3",
|
38
38
|
__name__[0:-6],
|
39
|
-
"aws-lambda-opensearch@2.85.
|
39
|
+
"aws-lambda-opensearch@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-lambda-opensearch
|
3
|
+
Version: 2.85.3
|
4
|
+
Summary: CDK Constructs for AWS Lambda to Amazon OpenSearch Service
|
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-lambda-opensearch/README.adoc)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
aws_solutions_constructs/aws_lambda_opensearch/__init__.py,sha256=oakXLF-vanJRWe7agj32gchcmS1Iuucwbo7BAtNKryk,20975
|
2
|
+
aws_solutions_constructs/aws_lambda_opensearch/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
3
|
+
aws_solutions_constructs/aws_lambda_opensearch/_jsii/__init__.py,sha256=XhG1f4pqL1siPa2FrmiOZWmAeDTqRyj2qA3hRTZ23Ls,1537
|
4
|
+
aws_solutions_constructs/aws_lambda_opensearch/_jsii/aws-lambda-opensearch@2.85.3.jsii.tgz,sha256=Rquxw3FqVwAdys8vZnyZZTh79Ecxa0t8Wk-zUKf0lDM,155948
|
5
|
+
aws_solutions_constructs_aws_lambda_opensearch-2.85.3.dist-info/LICENSE,sha256=wnT4A3LZDAEpNzcPDh8VCH0i4wjvmLJ86l3A0tCINmw,10279
|
6
|
+
aws_solutions_constructs_aws_lambda_opensearch-2.85.3.dist-info/METADATA,sha256=Rcikl7YMjrAl2mznbHkguaFaDBKNU3FT-j7QZvjE1YM,1287
|
7
|
+
aws_solutions_constructs_aws_lambda_opensearch-2.85.3.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
8
|
+
aws_solutions_constructs_aws_lambda_opensearch-2.85.3.dist-info/top_level.txt,sha256=hi3us_KW7V1ocfOqVsNq1o3w552jCEgu_KsCckqYWsg,25
|
9
|
+
aws_solutions_constructs_aws_lambda_opensearch-2.85.3.dist-info/RECORD,,
|
Binary file
|
@@ -1,197 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: aws-solutions-constructs.aws-lambda-opensearch
|
3
|
-
Version: 2.85.2
|
4
|
-
Summary: CDK Constructs for AWS Lambda to Amazon OpenSearch Service
|
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-lambda-opensearch 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_lambda_opensearch`|
|
50
|
-
| Typescript|`@aws-solutions-constructs/aws-lambda-opensearch`|
|
51
|
-
| Java|`software.amazon.awsconstructs.services.lambdaopensearch`|
|
52
|
-
|
53
|
-
## Overview
|
54
|
-
|
55
|
-
This AWS Solutions Construct implements an AWS Lambda function and Amazon OpenSearch Service with the least privileged permissions.
|
56
|
-
|
57
|
-
Here is a minimal deployable pattern definition:
|
58
|
-
|
59
|
-
Typescript
|
60
|
-
|
61
|
-
```python
|
62
|
-
import { Construct } from 'constructs';
|
63
|
-
import { Stack, StackProps, Aws } from 'aws-cdk-lib';
|
64
|
-
import { LambdaToOpenSearch } from '@aws-solutions-constructs/aws-lambda-opensearch';
|
65
|
-
import * as lambda from "aws-cdk-lib/aws-lambda";
|
66
|
-
|
67
|
-
const lambdaProps: lambda.FunctionProps = {
|
68
|
-
code: lambda.Code.fromAsset(`lambda`),
|
69
|
-
runtime: lambda.Runtime.NODEJS_20_X,
|
70
|
-
handler: 'index.handler'
|
71
|
-
};
|
72
|
-
|
73
|
-
new LambdaToOpenSearch(this, 'sample', {
|
74
|
-
lambdaFunctionProps: lambdaProps,
|
75
|
-
openSearchDomainName: 'testdomain',
|
76
|
-
// TODO: Ensure the Cognito domain name is globally unique
|
77
|
-
cognitoDomainName: 'globallyuniquedomain' + Aws.ACCOUNT_ID
|
78
|
-
});
|
79
|
-
```
|
80
|
-
|
81
|
-
Python
|
82
|
-
|
83
|
-
```python
|
84
|
-
from aws_solutions_constructs.aws_lambda_opensearch import LambdaToOpenSearch
|
85
|
-
from aws_cdk import (
|
86
|
-
aws_lambda as _lambda,
|
87
|
-
Aws,
|
88
|
-
Stack
|
89
|
-
)
|
90
|
-
from constructs import Construct
|
91
|
-
|
92
|
-
lambda_props = _lambda.FunctionProps(
|
93
|
-
code=_lambda.Code.from_asset('lambda'),
|
94
|
-
runtime=_lambda.Runtime.PYTHON_3_11,
|
95
|
-
handler='index.handler'
|
96
|
-
)
|
97
|
-
|
98
|
-
LambdaToOpenSearch(self, 'sample',
|
99
|
-
lambda_function_props=lambda_props,
|
100
|
-
open_search_domain_name='testdomain',
|
101
|
-
# TODO: Ensure the Cognito domain name is globally unique
|
102
|
-
cognito_domain_name='globallyuniquedomain' + Aws.ACCOUNT_ID
|
103
|
-
)
|
104
|
-
```
|
105
|
-
|
106
|
-
Java
|
107
|
-
|
108
|
-
```java
|
109
|
-
import software.constructs.Construct;
|
110
|
-
|
111
|
-
import software.amazon.awscdk.Stack;
|
112
|
-
import software.amazon.awscdk.StackProps;
|
113
|
-
import software.amazon.awscdk.Aws;
|
114
|
-
import software.amazon.awscdk.services.lambda.*;
|
115
|
-
import software.amazon.awscdk.services.lambda.Runtime;
|
116
|
-
import software.amazon.awsconstructs.services.lambdaopensearch.*;
|
117
|
-
|
118
|
-
new LambdaToOpenSearch(this, "sample",
|
119
|
-
new LambdaToOpenSearchProps.Builder()
|
120
|
-
.lambdaFunctionProps(new FunctionProps.Builder()
|
121
|
-
.runtime(Runtime.NODEJS_20_X)
|
122
|
-
.code(Code.fromAsset("lambda"))
|
123
|
-
.handler("index.handler")
|
124
|
-
.build())
|
125
|
-
.openSearchDomainName("testdomain")
|
126
|
-
// TODO: Ensure the Cognito domain name is globally unique
|
127
|
-
.cognitoDomainName("globallyuniquedomain" + Aws.ACCOUNT_ID)
|
128
|
-
.build());
|
129
|
-
```
|
130
|
-
|
131
|
-
## Pattern Construct Props
|
132
|
-
|
133
|
-
| **Name** | **Type** | **Description** |
|
134
|
-
|:-------------|:----------------|-----------------|
|
135
|
-
|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.|
|
136
|
-
|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.|
|
137
|
-
|openSearchDomainProps?|[`opensearchservice.CfnDomainProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_opensearchservice.CfnDomainProps.html)|Optional user provided props to override the default props for the OpenSearch Service.|
|
138
|
-
|openSearchDomainName|`string`|Domain name for the OpenSearch Service.|
|
139
|
-
|cognitoDomainName?|`string`|Optional Amazon Cognito domain name. If omitted the Amazon Cognito domain will default to the OpenSearch Service domain name.|
|
140
|
-
|createCloudWatchAlarms?|`boolean`|Whether to create the recommended CloudWatch alarms.|
|
141
|
-
|domainEndpointEnvironmentVariableName?|`string`|Optional name for the OpenSearch domain endpoint environment variable set for the Lambda function. Default is `DOMAIN_ENDPOINT`.|
|
142
|
-
|existingVpc?|[`ec2.IVpc`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html)|An optional, existing VPC into which this pattern should be deployed. When deployed in a VPC, the Lambda function will use ENIs in the VPC to access network resources. If an existing VPC is provided, the `deployVpc` property cannot be `true`. This uses `ec2.IVpc` to allow clients to supply VPCs that exist outside the stack using the [`ec2.Vpc.fromLookup()`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Vpc.html#static-fromwbrlookupscope-id-options) method.|
|
143
|
-
|vpcProps?|[`ec2.VpcProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.VpcProps.html)|Optional user provided properties to override the default properties for the new VPC. `enableDnsHostnames`, `enableDnsSupport`, `natGateways` and `subnetConfiguration` are set by the pattern, so any values for those properties supplied here will be overridden. If `deployVpc` is not `true` then this property will be ignored.|
|
144
|
-
|deployVpc?|`boolean`|Whether to create a new VPC based on `vpcProps` into which to deploy this pattern. Setting this to true will deploy the minimal, most private VPC to run the pattern:<ul><li> One isolated subnet in each Availability Zone used by the CDK program</li><li>`enableDnsHostnames` and `enableDnsSupport` will both be set to true</li></ul>If this property is `true` then `existingVpc` cannot be specified. Defaults to `false`.|
|
145
|
-
|
146
|
-
## Pattern Properties
|
147
|
-
|
148
|
-
| **Name** | **Type** | **Description** |
|
149
|
-
|:-------------|:----------------|-----------------|
|
150
|
-
|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|
|
151
|
-
|userPool|[`cognito.UserPool`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPool.html)|Returns an instance of `cognito.UserPool` created by the construct|
|
152
|
-
|userPoolClient|[`cognito.UserPoolClient`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPoolClient.html)|Returns an instance of `cognito.UserPoolClient` created by the construct|
|
153
|
-
|identityPool|[`cognito.CfnIdentityPool`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.CfnIdentityPool.html)|Returns an instance of `cognito.CfnIdentityPool` created by the construct|
|
154
|
-
|openSearchDomain|[`opensearchservice.CfnDomain`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_opensearchservice.CfnDomain.html)|Returns an instance of `opensearch.CfnDomain` created by the construct|
|
155
|
-
|openSearchRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of `iam.Role` created by the construct for `opensearch.CfnDomain`|
|
156
|
-
|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|
|
157
|
-
|vpc?|[`ec2.IVpc`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html)|Returns an interface on the VPC used by the pattern (if any). This may be a VPC created by the pattern or the VPC supplied to the pattern constructor.|
|
158
|
-
|
159
|
-
## Lambda Function
|
160
|
-
|
161
|
-
This pattern requires a lambda function that can post data into the OpenSearch. A sample function is provided [here](https://github.com/awslabs/aws-solutions-constructs/blob/master/source/patterns/%40aws-solutions-constructs/aws-lambda-opensearch/test/lambda/index.js).
|
162
|
-
|
163
|
-
## Default settings
|
164
|
-
|
165
|
-
Out of the box implementation of the Construct without any overrides will set the following defaults:
|
166
|
-
|
167
|
-
### AWS Lambda Function
|
168
|
-
|
169
|
-
* Configure limited privilege access IAM role for Lambda function
|
170
|
-
* Enable reusing connections with Keep-Alive for Node.js Lambda function
|
171
|
-
* Enable X-Ray Tracing
|
172
|
-
* Set Environment Variables
|
173
|
-
|
174
|
-
* (default) DOMAIN_ENDPOINT
|
175
|
-
* AWS_NODEJS_CONNECTION_REUSE_ENABLED
|
176
|
-
|
177
|
-
### Amazon Cognito
|
178
|
-
|
179
|
-
* Set password policy for User Pools
|
180
|
-
* Enforce the advanced security mode for User Pools
|
181
|
-
|
182
|
-
### Amazon OpenSearch Service
|
183
|
-
|
184
|
-
* Deploy best practices CloudWatch Alarms for the OpenSearch Service domain
|
185
|
-
* Secure the OpenSearch Service dashboard access with Cognito User Pools
|
186
|
-
* Enable server-side encryption for OpenSearch Service domain using AWS managed KMS Key
|
187
|
-
* Enable node-to-node encryption for the OpenSearch Service domain
|
188
|
-
* Configure the cluster for the OpenSearch Service domain
|
189
|
-
|
190
|
-
## Architecture
|
191
|
-
|
192
|
-

|
193
|
-
|
194
|
-
---
|
195
|
-
|
196
|
-
|
197
|
-
© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
@@ -1,9 +0,0 @@
|
|
1
|
-
aws_solutions_constructs/aws_lambda_opensearch/__init__.py,sha256=Ukik9uPsu5EfnKGZeCTztfbbkLfFOEZ2-vXElZVVk2s,30398
|
2
|
-
aws_solutions_constructs/aws_lambda_opensearch/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
3
|
-
aws_solutions_constructs/aws_lambda_opensearch/_jsii/__init__.py,sha256=QCZwkXQr59ck7HmQW8--KShoTxcwZ3HNp8VelNBco2k,1537
|
4
|
-
aws_solutions_constructs/aws_lambda_opensearch/_jsii/aws-lambda-opensearch@2.85.2.jsii.tgz,sha256=jhzHLy9GyLH76PyGKB1_4bSMM9B8KsZoDhfJgFIORYM,158507
|
5
|
-
aws_solutions_constructs_aws_lambda_opensearch-2.85.2.dist-info/LICENSE,sha256=wnT4A3LZDAEpNzcPDh8VCH0i4wjvmLJ86l3A0tCINmw,10279
|
6
|
-
aws_solutions_constructs_aws_lambda_opensearch-2.85.2.dist-info/METADATA,sha256=YxrjP_96lItSow__mDVKxJsKUUNJRL7BiS5ko71MW1s,10710
|
7
|
-
aws_solutions_constructs_aws_lambda_opensearch-2.85.2.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
8
|
-
aws_solutions_constructs_aws_lambda_opensearch-2.85.2.dist-info/top_level.txt,sha256=hi3us_KW7V1ocfOqVsNq1o3w552jCEgu_KsCckqYWsg,25
|
9
|
-
aws_solutions_constructs_aws_lambda_opensearch-2.85.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|