DEV Community

Cover image for Cloud Resume Challenge, Days 6-7 - Code, Code, AWS
CurtFarley
CurtFarley

Posted on

Cloud Resume Challenge, Days 6-7 - Code, Code, AWS

Hello there. (If you don't get the reference, I'm not sure we can be friends...)

A short follow up to my last post, got my resume page mostly ready. Still not 100% done, have the visitor counter to complete (this post starts the tale of that journey), but complete enough to release it to be free. You can find it here: Resume

So this part of the project had me: write Python code to write a value to a DynamoDB table, setup a Lambda function to then use that code, and configure IAM permissions so that Lambda could interact with DynamoDB. And this is just the first half of the back-end.. sheesh....

As an infrastructure guy, this is now starting to get into my wheelhouse. But not particularly easy for me - all new stuff this is. A lot to learn, mostly by trial and error. But I can report that I was successful in getting it done and working even!

While I had been trying to learn Python prior to this, that fell to the wayside due to a slight shift in priority (studying for AWS Networking exam). I knew I wouldn't be writing code from scratch, there's no need to reinvent the wheel here. But I'd still need to figure out the how/what/why of the specific code snippet that I chose to model from. So that's what I did.

Time for the fun to start:
After some Googling, I found some code that I thought would work and would be simple enough that I could reverse engineer, modify, & test to fit my environment. Not unexpectedly, just changing variables and names to match my environment didn't work. At all. Time to hit the documentation, for Python, for VS Code, & for AWS. I learned I needed to do more setup and config for VS Code to get it to work with AWS and Python.
I learned (by doing this time, previously just theory for the Solutions Architect exam) how to create and apply IAM policies and roles to Lambda.
I learned syntax for Python to interact with DynamoDB.
And I learned a little bit about Lambda, specifically that you (apparently) need to deploy your function before you can actually test it. Frustrating when the AWS documentation I read and the 3 or 4 videos I watched, none of them ever said to deploy to test - they just hit the 'test' button and whoomp, there it is....

After getting my code to write a value into my table, I tackled the change to update/increment the value rather than just write one. Wasn't too bad honestly, just a simple keyword change from 'set' to 'add'. There's probably a hundred other little things that I could/should say, but I'm trying to not get too long winded and I feel I'm close to that limit.

I will share this photo of how I'm 'blueprinting' the current goal/task at hand. I do find this to be quite helpful.
Goal 1

In summary, all tasks for this goal are complete. My next goal is setup & test an API Gateway to talk to Lambda, starting on that soon.

As always, turn around, don't drown & keep it between the white lines....

Top comments (0)