DEV Community

Cover image for SAM: Serverless Application Model (CloudResumeChallenge)
Sudha Chandran B C
Sudha Chandran B C

Posted on

4 1

SAM: Serverless Application Model (CloudResumeChallenge)

After creating simple Resume with html and css and uploading into S3 with CloudFront tools, here come's the difficult task for creating DynamoDB table, API and Lambda function using Python using SAM (Serverless Application Model).

I spent some time in learning Python and boto3 and how to use both in SAM templates which are in yaml files.

Being first time working on yaml files, it took some time to go through examples and understand the concept.

Then created required assets one by one in SAM Template.

  1. Dynamo DB: To save the number of visits to my resume site.
  2. Lambda: A python function to fetch, create and update the visit count into Dynamo DB Table.
  3. API: Do get the number of visits from Lambda function to avoid direct communication with Dynamo DB from the frontend code.

DynamoDB

Added parameter in the template to get the Tablename in CLI.
And use it in the template to create user defined table name.

Parameters in CLI:
Alt Text

Table Created:
Alt Text

Lambda

Alt Text

API Gateway

Alt Text

SAM Stack Creation

Alt Text

API endpoint Created

Alt Text

So till now our Architecture will look like below:

Alt Text

Pending: Set up GitHub Actions to automate build, test and deployment of Code.

Hopefully i will complete it ASAP.

Thank you for reading! 😊

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay