I've been going through this tutorial posted by amazon. On the step titled "Enabling the lambda blueprint", it references a dynamodb-to-elasticsearch
blueprint. In my AWS console, there is no such blueprint. Does anybody know what the Python code for this blueprint looks like? Am I unable to see this because of my specific AWS account, or has AWS removed this?
With DynamoDB Streams, you can trigger a Lambda function to perform additional work each time a DynamoDB table is updated. Lambda reads records from the stream and invokes your function synchronously with an event that contains stream records.
AWS Lambda: Allows a Lambda function to access an Amazon DynamoDB table. This example shows how you might create an identity-based policy that allows read and write access to a specific Amazon DynamoDB table. The policy also allows writing log files to CloudWatch Logs.
You can use DynamoDB as a durable store, Elasticsearch to extend its search capabilities, and Dynamo Streams to join them together.
You need to make sure a DynamoDB stream is enabled on your table including both old and new images. First, pull the DynamoDB stream record out of the Kinesis stream record. Then, determine whether the DynamoDB stream record represents an insertion, update or deletion. Third, delegate appropriately and upsert the corresponding document in ES for insertions and updates, and delete the corresponding document in ES for deletions.
For the time being, you can adapt the Python lambda handler shared here on Github - it parses stream records and writes documents to ES.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With