How edelwud/dynamodb-s3-export works
Project type and purpose
• This is an Infrastructure‑as‑Code (IaC) project using AWS CDK in TypeScript.
• Its goal: provision AWS resources that run a Lambda function to export data from a DynamoDB table into an S3 bucket.
• It also includes a GitHub Actions stack for CI/CD.
File structure
• Top‑level CDK entrypoint: src/main.ts
• Stacks under src/:
• network.stack.ts – VPC, subnets, security groups
• dynamodb‑s3‑export.stack.ts – DynamoDB table, S3 bucket, IAM roles
• github‑actions.stack.ts – constructs to set up GitHub Actions secrets/roles
• Stage definition: src/exporter‑application.stage.ts groups multiple stacks into a deployable unit.
• Lambda code under src/services/:
• export-function.ts and export.lambda.ts – handler logic using AWS Powertools
• CI config: .github/workflows//*.yml**
README for additional insights
• Mentions a separate “Security” repository for initializing the GitHubActionsStack
Main components
a. Developer / GitHub
– Pushes code → triggers GitHub Actions workflow
b. CI/CD Pipeline (GitHub Actions)
– Builds & deploys the CDK app
– Deploys three stacks in the exporter stage
c. Network Stack
– VPC, public/private subnets, security groups
d. DynamoDB‑to‑S3 Export Stack
– CloudWatch Logs (optional)
e. Service Code
– Lambda handler code uses AWS Powertools for tracing/metrics
f. GitHub Actions Stack
– IAM Role/Secrets to allow GitHub to assume deploy permissions
Relationships and interactions
• Network Stack provisions VPC → all other resources are deployed into that VPC context.
• Lambda ↔ DynamoDB (Read)
• Lambda → S3 (Write)
– GitHub Actions Role → CDK deploy permissions
– Lambda Role → DynamoDB & S3 permissions
Architectural patterns and design principles
• Separation of Concerns: distinct stacks for network, application, CI/CD
• CDK Stage Pattern: exporter-application.stage.ts groups stacks for single deploy
• Infrastructure as Code: all resources defined in TypeScript
• Modular Lambda design: service code separated under services/
• Use of AWS Powertools for observability
Final checklist
• [ ] Clearly labeled components: Developer, GitHub Actions, CDK, VPC, Lambda, DynamoDB, S3