How nickperugini/ptb-agent-5548 works
Project Type & Purpose
• This is an AWS Infrastructure-as-Code project using Terraform to deploy a serverless architecture.
• Purpose: Automate the provisioning of four Lambda functions behind HTTP API Gateways, a shared S3 bucket, and a DynamoDB table to accelerate simple doc-generation tasks.
File Structure
• Top-level Terraform files: main.tf (resource definitions), variables.tf (input parameters), outputs.tf (deployment outputs).
• lambda/ directory: four subdirectories (lambda1…lambda4), each containing an index.py (Lambda handler).
• Implied architecture: one VPC, subnets, security groups, IAM roles, API Gateway HTTP APIs, S3 bucket, DynamoDB table, and four Lambdas.
Extract Key Details from README
• Two API Gateways (api1 routes lambda1 & lambda2; api2 routes lambda3 & lambda4).
• Shared S3 bucket for all Lambdas.
• DynamoDB table used by lambda1.
• VPC encapsulates networking for Lambdas.
Main Components
• Subnets (public/private as defined)
• Security Groups
• Lambda1, Lambda2, Lambda3, Lambda4 (all deployed in the VPC)
b. API Gateway HTTP APIs
• API1 → routes to Lambda1 & Lambda2
• API2 → routes to Lambda3 & Lambda4
c. Data Stores (outside VPC)
• S3 bucket (shared by all Lambdas)
• DynamoDB table (used by Lambda1)
Relationships & Data Flows
• Calls with “PutObject” or “PutItem” to show the AWS API operations.
Architectural Patterns & Design Principles
• Serverless microservices: each Lambda has a single responsibility.
• IaC (Terraform) for reproducible infrastructure.
• Separation of concerns: API layer (Gateway), compute layer (Lambda), data layer (S3/DynamoDB).
• Network boundary: VPC isolates Lambda compute from the public internet (except via API GW).
Putting It All Together
• API1 → Lambda1 & Lambda2
• API2 → Lambda3 & Lambda4
• Lambda1,2,3,4 → S3
• Lambda1 → DynamoDB