Completed my first AWS Mini Project today. The services used were DynamoDB, Lambda, and SNS.
I first created a DynamoDB table where I manually entered in fictional data for a cat adoption agency. I entered in 8 kittens, their names and adoption statuses. In a real world example this would have been populated from a front-end website. In an ideal world all cats would have homes with all the cat nip and sunlight a kitten could dream of.
Now onto creating the Lambda function, which is named cat-adoption-function. In this portion I inserted code that will iterate through all the cat records that Dynamo DB passes to the Lambda function, and then publish the message for our subscribers to receive.
Next, I gave the Lambda function created permission to access DynamoDB so it can read the data from the DynamoDB Stream. Without this permission, the function created will not work.
Next, I enabled the DynamoDB Stream that will trigger that cat-adoption-function every time a cat's adoption status is changed to true.
The final step involved testing it out. In the DynamoDB console I ran a scan to ensure the code is working as expected and that the Lambda function is correctly reading and processing all of the table items. At the initial scan all of the adoption statuses were set to false. In a real world example this testing phase will be crucial to identify any data insertion, bug, and performance issues that could occur with larger datasets.
As best practice with all projects, my final step involved cleaning up, by deleting all the resources used in this project.
And voila! There goes my first project, looking forward to the next. Shout out to my favorite AWS course that is helping develop these skills and support my learning with these projects: on Unsplash
SOCIAL SHARE CARD GENERATOR