aws-lambda-opensearch
Reference Documentation: | https://docs.aws.amazon.com/solutions/latest/constructs/ |
Language | Package |
---|---|
|
|
|
|
|
|
Overview
This AWS Solutions Construct implements an AWS Lambda function and Amazon OpenSearch Service with the least privileged permissions.
Here is a minimal deployable pattern definition:
Pattern Construct Props
Name | Type | Description |
---|---|---|
existingLambdaObj? |
Existing instance of Lambda Function object, providing both this and
|
|
lambdaFunctionProps? |
User provided props to override the default props for the Lambda function. |
|
openSearchDomainProps? |
Optional user provided props to override the default props for the OpenSearch Service. |
|
openSearchDomainName |
|
Domain name for the OpenSearch Service. |
cognitoDomainName? |
|
Optional Amazon Cognito domain name. If omitted the Amazon Cognito domain will default to the OpenSearch Service domain name. |
createCloudWatchAlarms? |
|
Whether to create the recommended CloudWatch alarms. |
domainEndpointEnvironmentVariableName? |
|
Optional name for the
OpenSearch domain endpoint environment variable set for the Lambda
function. Default is |
existingVpc? |
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
|
|
vpcProps? |
Optional user provided properties to override the default properties
for the new VPC. |
|
deployVpc? |
|
Whether to create a new VPC based on |
Pattern Properties
Name | Type | Description |
---|---|---|
lambdaFunction |
Returns an instance of |
|
userPool |
Returns an instance of |
|
userPoolClient |
Returns an instance of |
|
identityPool |
Returns an instance of |
|
openSearchDomain |
Returns an instance of |
|
openSearchRole |
Returns an instance of |
|
cloudWatchAlarms? |
Returns a list of |
|
vpc? |
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. |
Lambda Function
This pattern requires a lambda function that can post data into the
OpenSearch. A sample function is provided
here
Default settings
Out of the box implementation of the Construct without any overrides will set the following defaults:
AWS Lambda Function
-
Configure limited privilege access IAM role for Lambda function
-
Enable reusing connections with Keep-Alive for Node.js Lambda function
-
Enable X-Ray Tracing
-
Set Environment Variables
-
(default) DOMAIN_ENDPOINT
-
AWS_NODEJS_CONNECTION_REUSE_ENABLED
-
Amazon Cognito
-
Set password policy for User Pools
-
Enforce the advanced security mode for User Pools
Amazon OpenSearch Service
-
Deploy best practices CloudWatch Alarms for the OpenSearch Service domain
-
Secure the OpenSearch Service dashboard access with Cognito User Pools
-
Enable server-side encryption for OpenSearch Service domain using AWS managed KMS Key
-
Enable node-to-node encryption for the OpenSearch Service domain
-
Configure the cluster for the OpenSearch Service domain
Architecture

Github
Go to the Github repo