aws-lambda-elasticsearch-kibana
Reference Documentation: | https://docs.aws.amazon.com/solutions/latest/constructs/ |
Language | Package |
---|---|
|
|
|
|
|
|
Overview
This AWS Solutions Construct implements an AWS Lambda function and Amazon Elasticsearch Service with the least privileged permissions.
Some cluster configurations (e.g VPC access) require the existence of
the AWSServiceRoleForAmazonElasticsearchService
Service-Linked Role in
your account.
You will need to create the service-linked role using the AWS CLI once in any account using this construct (it may have already been run to support other stacks):
aws iam create-service-linked-role --aws-service-name es.amazonaws.com
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. |
|
esDomainProps? |
Optional user provided props to override the default props for the Elasticsearch Service |
|
domainName |
|
Domain name for the Cognito and the Elasticsearch Service |
cognitoDomainName? |
|
Optional Cognito Domain Name, if provided it will be used for Cognito Domain, and domainName will be used for the Elasticsearch Domain |
createCloudWatchAlarms? |
|
Whether to create recommended CloudWatch alarms |
domainEndpointEnvironmentVariableName? |
|
Optional Name for the ElasticSearch domain endpoint environment variable set for the Lambda function. |
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 |
|
elasticsearchDomain |
Returns an instance of |
|
elasticsearchRole |
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
Elasticsearch. 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 Elasticsearch Service
-
Deploy best practices CloudWatch Alarms for the Elasticsearch Service domain
-
Secure the Kibana dashboard access with Cognito User Pools
-
Enable server-side encryption for the Elasticsearch Service domain using AWS managed KMS Key
-
Enable node-to-node encryption for the Elasticsearch Service domain
-
Configure the cluster for the Elasticsearch Service domain
Architecture

Github
Go to the Github repo