DynamoDB as API

akbaralihussain

Akbar Ali Hussain

Posted on April 12, 2024

DynamoDB as API

Image description
I developed a Terraform Module "DynamoDB-as-API" which will create a AWS REST-API to Read items from your DynamoDB tables (Create, Update, Delete will be added soon). You just provide the list of DynamoDB tables, this module will read schema of all tables and will generate endpoints accordingly.

eg. Below code will create an API with GET endpoints for books and authors for each Partition Key and Sort Key (if any). Since it read directly from DynamoDB without any Lambda, the response time will be lightning-fast...

module "dynamodb-as-api" {
  source  = "CloudPediaAI/dynamodb-as-api/aws"
  version = "1.0.0"

  api_name = "Library-API"
  domain_name = "city-library.com"

  dynamodb_tables = {
    "books" = {
      table_name         = "books-table"
      allowed_operations = "R"
    },
    "authors" = {
      table_name         = "authors-table"
      allowed_operations = "R"
    }
  }
  providers = {
    aws           = aws.provder_for_api
    aws.us-east-1 = aws.provder_for_ssl
  }
}
Enter fullscreen mode Exit fullscreen mode

Helpful Resources

Use it and please share your feedback which will help me to improve it.

💖 💪 🙅 🚩
akbaralihussain
Akbar Ali Hussain

Posted on April 12, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

DynamoDB as API
terraform DynamoDB as API

April 12, 2024