# vulcantechnologiesllc/aws-lambda-containers architecture

> Architecture diagram of the GitHub repository vulcantechnologiesllc/aws-lambda-containers, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vulcantechnologiesllc/aws-lambda-containers
- Repository: https://github.com/vulcantechnologiesllc/aws-lambda-containers

## Overview

##### Project Type and Purpose
- This is a serverless, infrastructure-as-code project demonstrating how to package a Python AWS Lambda function as a custom Docker container, push that container to ECR, and deploy it via Terraform.
- Key use cases: custom dependencies, ISSO-approved images, reproducible env, Terraform-driven Lambda provisioning.

##### File Structure
- Top-level files:
- Dockerfile (builds a Lambda-compatible Python 3.11 container)
- lambda_function.py (the Lambda handler entry point)
- requirements.txt (Python dependencies)
- lambda.tf (Terraform configuration to provision IAM roles, ECR repo references, and the Lambda function)
- README.md (project overview and instructions)
- No separate “src” or “frontend” – it’s purely backend+infra.

##### Extract Insights from the README
- Custom base image on public ECR (public.ecr.aws/lambda/python:3.11)
- Docker build → produce Lambda container image
- Push to ECR → Terraform uses that image URI
- Terraform deploys AWS Lambda with IAM roles, environment variables, and any triggers you add (e.g., API Gateway, S3).

a. Main Components
1. Developer Machine / CI Pipeline
2. Docker Build Process
3. Amazon ECR (Elastic Container Registry)
4. Terraform (IaC)
5. AWS Lambda Function (runtime)
6. IAM Roles & Policies
7. Optional Event Sources (API Gateway, S3, CloudWatch Events)
8. CloudWatch Logs
b. Relationships & Data Flows
- Developer → (docker build) → Docker Daemon → (container image) → ECR
- Developer / CI → (terraform apply) → AWS API → create/update: IAM roles, Lambda resource (pointing at ECR image URI)
- Event Source → (invoke) → Lambda (container image) → (write) → CloudWatch Logs
c. Architectural Patterns
- Serverless + Containerization: container-as-a-service
- IaC: Terraform-driven resource provisioning
- Clear separation of build (Docker) vs. deploy (Terraform) vs. runtime (AWS Lambda)
d. Key Technologies & Libraries
- Docker (build-time)
- AWS ECR (registry)
- Terraform AWS Provider (lambda.tf)
- Python 3.11 runtime inside container
- AWS IAM (roles/policies for Lambda execution)
- AWS CloudWatch (logs/tracing)

##### Detail
- Separation of concerns: build vs. registry vs. deploy vs. runtime vs. monitoring.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Developer["Developer Machine / CI Pipeline"]:::dev
    Docker["Docker Build Process"]:::build
    Req["Python Dependencies Management\nrequirements.txt"]:::build
    ECR["Amazon ECR"]:::registry
    Terraform["Terraform IaC\nlambda.tf"]:::iac
    IAM["AWS IAM Roles & Policies"]:::iam
    Lambda["AWS Lambda Function\nlambda_function.py"]:::runtime
    Event["Event Sources\n(API Gateway/S3)"]:::event
    Logs["AWS CloudWatch Logs"]:::monitor

    Developer -->|"docker build & push"| Docker
    Docker -->|"container image"| ECR
    Developer -->|"terraform apply"| Terraform
    Terraform -->|"provision IAM & policies"| IAM
    Terraform -->|"deploy container"| Lambda
    Event -->|"Invoke"| Lambda
    Lambda -->|"Log"| Logs

    click Developer "https://github.com/vulcantechnologiesllc/aws-lambda-containers/blob/main/README.md"
    click Docker "https://github.com/vulcantechnologiesllc/aws-lambda-containers/tree/main/Dockerfile"
    click Req "https://github.com/vulcantechnologiesllc/aws-lambda-containers/blob/main/requirements.txt"
    click Terraform "https://github.com/vulcantechnologiesllc/aws-lambda-containers/blob/main/lambda.tf"
    click Lambda "https://github.com/vulcantechnologiesllc/aws-lambda-containers/blob/main/lambda_function.py"

    classDef dev fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef build fill:#ffe5b4,stroke:#333,stroke-width:1px
    classDef registry fill:#e0b3ff,stroke:#333,stroke-width:1px
    classDef iac fill:#d4edda,stroke:#333,stroke-width:1px
    classDef iam fill:#d1ecf1,stroke:#333,stroke-width:1px
    classDef runtime fill:#fff3cd,stroke:#333,stroke-width:1px
    classDef event fill:#f8f9fa,stroke:#333,stroke-width:1px
    classDef monitor fill:#e2e3e5,stroke:#333,stroke-width:1px
```
