A Simple Serverless API

Serverless API to query and display my certification data

This is a serverless app involving and API gateway as the entry point, triggering a python lambda that queries a DynamoDB table and displays information on the certifications I hold. As you can see the API gateway already has a custom domain name associated with it and a basic path mapping hides the stage name

The architecture looks like the following

https://certdata.muhilvannan.com/getCertData

Result of the API query is displayed in the iframe below

The lambda code is as follows :

import json
import boto3

certDataTable = boto3.client('dynamodb')

def list_tables():
    response = certDataTable.list_tables()
    return response

def scan_table(table):
    response = certDataTable.scan(
        TableName=table
    )
    return response

def lambda_handler(event, context):
    
    all_tables=list_tables()
   
    for table in all_tables['TableNames']:
        print(table)
        items=scan_table(table)
        print(items)
    
    return {
        'statusCode': 200,
        'body': json.dumps(items)
    }