Publine is a proof-of-concept for -
- DynamoDB events getting sent over the DynamoDB stream on TTL expiry
- an AWS Lambda ingesting events from a DynamoDB stream
- a second AWS Lambda that ensures that items are deleted on expiry and placed on Dynamodb stream
There are two major steps to deploy - building the lambda and deploying the lambda alongwith DynamoDB and related infrastructure
This is the lambda (named runner) that ingests events from DynamoDB streams. There is a Makefile in the folder of runner that has the instruction to build the lambda
make runner
Prerequisites:
- Setup your AWS access key and secret in
~/.aws/credentials - In your S3 account, create a bucket called
publinestate. This name is currently hardcoded in infrastructure/main.tf
Run the following -
export AWS_PROFILE=name_of_your_profile_in_aws_credentialsterraform initterraform apply
Note: A deploy of a lambda requires both the major steps listed above - building the lambda and then redoing terraform apply
These branches are in increasing order of development. After the first branch, the others are pretty incremental in change
- 1.0: Basic infrastructure setup and lambda deploy
- 1.1: Update lambda function structure
- 1.2: Attribute mapping from DynamoDB streamed event into Lambda
- 1.3: Filter criteria on events before they are sent to the Lambda
- 2.0: Lambda triggered as a cronjob by Cloudwatch Alarm
- 2.1: Lambda named cleaner ensures that items are deleted on expiry and placed on Dynamodb stream