AWS API Gateway with DynamoDB
Deploy AWS API Gateway to read and update DynamoDB without Lambda.
How to create an Amazon API Gateway REST API that integrates with an Amazon DynamoDB table to read and update data?

Introduction
This topic shows step-by-step how to create the Amazon API Gateway REST API that integrates with an Amazon DynamoDB table named resumeTable. The API integrates directly with the DynamoDB API and supports GetItem and PutItem actions.
All codes created by the CDK (Python) to implement the activities such as creating DynamoDB table, API Gateway with DynamoDB integration, providing all least privilege IAM roles and mapping templates for integration request & response.
Requirements
- Python version 3.9 or above.
- Amazon Web Services (AWS) Account: The IAM user must have sufficient permissions to make necessary AWS service calls and manage AWS resources.
- AWS Cloud Development Kit (CDK) in Python installed.
Get started with CDK
Create and go to the working folder, then initialize the CDK Python project from CLI Terminal.
mkdir resume-apigw-dynamodb
cd resume-apigw-dynamodb
cdk init app --language python
Activate Python environment.
source .venv/bin/activate
Install the required packages.
pip install -r requirements.txt
Project structure
If configured properly, the project structure will be shown under the working directory \resume-apigw-dynamodb as below:
resume-apigw-dynamodb
├── data
│ └── resume.json
├── integration