DEV Community

Akbar Ali Hussain
Akbar Ali Hussain

Posted on

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.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

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

Okay