Package: aws-solutions-constructs.aws-dynamodb-stream-lambda-elasticsearch-kibana
aws-dynamodb-stream-lambda-elasticsearch-kibana module---Some of our early constructs don’t meet the naming standards that evolved for the library. We are releasing completely feature compatible versions with corrected names. The underlying implementation code is the same regardless of whether you deploy the construct using the old or new name. We will support both names for all 1.x releases, but in 2.x we will only publish the correctly named constructs. This construct is being replaced by the functionally identical aws-dynamodbstreams-lambda-elasticsearch-kibana.Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/LanguagePackagePythonaws_solutions_constructs.aws_dynamodb_stream_elasticsearch_kibanaTypescript@aws-solutions-constructs/aws-dynamodb-stream-lambda-elasticsearch-kibanaJavasoftware.amazon.awsconstructs.services.dynamodbstreamlambdaelasticsearchkibanaOverviewThis AWS Solutions Construct implements Amazon DynamoDB table with stream, AWS Lambda function and Amazon Elasticsearch Service with the least privileged permissions.Here is a minimal deployable pattern definition:Typescript//aws-dynamodb-stream-lambda-elasticsearch-kibanahasbeendeprecatedforCDKV2infavorofaws-dynamodbstreams-lambda-elasticsearch-kibana.//ThissampleusestheCDKV1syntaximport*ascdkfrom'@aws-cdk/core';import*aslambdafrom'@aws-cdk/aws-lambda';import{DynamoDBStreamToLambdaToElasticSearchAndKibana,DynamoDBStreamToLambdaToElasticSearchAndKibanaProps}from'@aws-solutions-constructs/aws-dynamodb-stream-lambda-elasticsearch-kibana';constconstructProps:DynamoDBStreamToLambdaToElasticSearchAndKibanaProps={lambdaFunctionProps:{code:lambda.Code.fromAsset(`lambda`),runtime:lambda.Runtime.NODEJS_14_X,handler:'index.handler'},domainName:'test-domain',//TODO:EnsuretheCognitodomainnameisgloballyuniquecognitoDomainName:'globallyuniquedomain'+cdk.Aws.ACCOUNT_ID};newDynamoDBStreamToLambdaToElasticSearchAndKibana(this,'test',constructProps);Python# aws-dynamodb-stream-lambda-elasticsearch-kibana has been deprecated for CDK V2 in favor of aws-dynamodbstreams-lambda-elasticsearch-kibana.# This sample uses the CDK V1 syntaxfromaws_solutions_constructs.aws_dynamodb_stream_lambda_elasticsearch_kibanaimportDynamoDBStreamToLambdaToElasticSearchAndKibana,DynamoDBStreamToLambdaToElasticSearchAndKibanaPropsfromaws_cdkimport(aws_lambdaas_lambda,core)DynamoDBStreamToLambdaToElasticSearchAndKibana(self,'test',lambda_function_props=_lambda.FunctionProps(code=_lambda.Code.from_asset('lambda'),runtime=_lambda.Runtime.PYTHON_3_9,handler='index.handler'),domain_name='test-domain',# TODO: Ensure the Cognito domain name is globally uniquecognito_domain_name='globallyuniquedomain'+core.Aws.ACCOUNT_ID)Java// aws-dynamodb-stream-lambda-elasticsearch-kibana has been deprecated for CDK V2 in favor of aws-dynamodbstreams-lambda-elasticsearch-kibana.// This sample uses the CDK V1 syntaximportsoftware.constructs.Construct;importsoftware.amazon.awscdk.core.*;importsoftware.amazon.awscdk.services.lambda.*;importsoftware.amazon.awscdk.services.lambda.Runtime;importsoftware.amazon.awsconstructs.services.dynamodbstreamlambdaelasticsearchkibana.*;newDynamoDBStreamToLambdaToElasticSearchAndKibana(this,"test",newDynamoDBStreamToLambdaToElasticSearchAndKibanaProps.Builder().lambdaFunctionProps(newFunctionProps.Builder().runtime(Runtime.NODEJS_14_X).code(Code.fromAsset("lambda")).handler("index.handler").build()).domainName("test-domain").cognitoDomainName("globallyuniquedomain"+Aws.ACCOUNT_ID).build());Pattern Construct PropsNameTypeDescriptionexistingLambdaObj?lambda.FunctionExisting instance of Lambda Function object, providing both this andlambdaFunctionPropswill cause an error.lambdaFunctionProps?lambda.FunctionPropsUser provided props to override the default props for the Lambda function.dynamoTableProps?dynamodb.TablePropsOptional user provided props to override the default props for DynamoDB TableexistingTableInterface?dynamodb.ITableExisting instance of DynamoDB table object or interface, providing both this anddynamoTablePropswill cause an error.dynamoEventSourceProps?aws-lambda-event-sources.DynamoEventSourcePropsOptional user provided props to override the default props for DynamoDB Event SourceesDomainProps?elasticsearch.CfnDomainPropsOptional user provided props to override the default props for the Elasticsearch ServicedomainNamestringDomain name for the Cognito and the Elasticsearch ServicecreateCloudWatchAlarmsbooleanWhether to create recommended CloudWatch alarmsPattern PropertiesNameTypeDescriptiondynamoTableInterfacedynamodb.ITableReturns an instance of dynamodb.ITable created by the constructdynamoTable?dynamodb.TableReturns an instance of dynamodb.Table created by the construct. IMPORTANT: If existingTableInterface was provided in Pattern Construct Props, this property will beundefinedlambdaFunctionlambda.FunctionReturns an instance of lambda.Function created by the constructuserPoolcognito.UserPoolReturns an instance of cognito.UserPool created by the constructuserPoolClientcognito.UserPoolClientReturns an instance of cognito.UserPoolClient created by the constructidentityPoolcognito.CfnIdentityPoolReturns an instance of cognito.CfnIdentityPool created by the constructelasticsearchDomainelasticsearch.CfnDomainReturns an instance of elasticsearch.CfnDomain created by the constructelasticsearchDomainiam.RoleReturns an instance of iam.Role created by the construct for elasticsearch.CfnDomaincloudwatchAlarms?cloudwatch.Alarm[]Returns a list of cloudwatch.Alarm created by the constructLambda FunctionThis pattern requires a lambda function that can post data into the Elasticsearch from DynamoDB stream. A sample function is providedhere.Default settingsOut of the box implementation of the Construct without any override will set the following defaults:Amazon DynamoDB TableSet the billing mode for DynamoDB Table to On-Demand (Pay per request)Enable server-side encryption for DynamoDB Table using AWS managed KMS KeyCreates a partition key called 'id' for DynamoDB TableRetain the Table when deleting the CloudFormation stackEnable continuous backups and point-in-time recoveryAWS Lambda FunctionConfigure limited privilege access IAM role for Lambda functionEnable reusing connections with Keep-Alive for NodeJs Lambda functionEnable X-Ray TracingEnable 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 failureSet Environment VariablesAWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)Amazon CognitoSet password policy for User PoolsEnforce the advanced security mode for User PoolsAmazon Elasticsearch ServiceDeploy best practices CloudWatch Alarms for the Elasticsearch DomainSecure the Kibana dashboard access with Cognito User PoolsEnable server-side encryption for Elasticsearch Domain using AWS managed KMS KeyEnable node-to-node encryption for Elasticsearch DomainConfigure the cluster for the Amazon ES domainArchitecture© Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.