# chinmayto/terraform-aws-lambda-api-gateway-dynamodb architecture

> Architecture diagram of the GitHub repository chinmayto/terraform-aws-lambda-api-gateway-dynamodb, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chinmayto/terraform-aws-lambda-api-gateway-dynamodb
- Repository: https://github.com/chinmayto/terraform-aws-lambda-api-gateway-dynamodb

## Overview

##### Main Components
- API Gateway – Acts as the entry point, receiving and routing HTTP requests.
- DynamoDB – Serves as the persistent storage for books.

##### Relationships and Interactions
- Optionally, include a connection from Lambda (and/or API Gateway) to “CloudWatch Logs” to indicate that operational logs and execution details are captured for monitoring.

##### Architectural Patterns and Design Principles
- Use of AWS managed services to ensure scalability and reduced operational overhead.
- Clearly label RESTful endpoints (e.g., “GET /books”, “POST /book”, “PATCH /book”, “DELETE /book”) at the API Gateway level—though you do not need to include the underlying Terraform resources.

##### Relevant Technologies and Frameworks
- API Gateway (for routing HTTP requests)
- AWS Lambda with Python (for backend processing)
- DynamoDB (for NoSQL storage)
- AWS CloudWatch (for logging and monitoring)

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["Client / Consumer"]:::client
    APIGateway["API Gateway – REST API"]:::api
    Lambda["Book CRUD Lambda Function"]:::compute
    DynamoDB["DynamoDB – Books_Table"]:::database
    CloudWatch["CloudWatch Logs"]:::monitor

    Client -->|"sendsRequest"| APIGateway
    APIGateway -->|"forwardsRequest"| Lambda
    Lambda <-->|"CRUD"| DynamoDB
    Lambda -->|"logsTo"| CloudWatch

    click APIGateway "https://github.com/chinmayto/terraform-aws-lambda-api-gateway-dynamodb/blob/main/api_gateway.tf"
    click Lambda "https://github.com/chinmayto/terraform-aws-lambda-api-gateway-dynamodb/blob/main/lambda/lambda_function.py"
    click DynamoDB "https://github.com/chinmayto/terraform-aws-lambda-api-gateway-dynamodb/blob/main/dynamodb.tf"

    classDef client fill:#FFEEAD,stroke:#333,stroke-width:2px;
    classDef api fill:#AEDFF7,stroke:#333,stroke-width:2px;
    classDef compute fill:#C8E6C9,stroke:#333,stroke-width:2px;
    classDef database fill:#FFE0B2,stroke:#333,stroke-width:2px;
    classDef monitor fill:#D1C4E9,stroke:#333,stroke-width:2px;
```
