# dkgit2/image-resizing-project-on-aws architecture

> Architecture diagram of the GitHub repository dkgit2/image-resizing-project-on-aws, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dkgit2/image-resizing-project-on-aws
- Repository: https://github.com/dkgit2/image-resizing-project-on-aws

## Overview

This repository defines a serverless image-thumbnail pipeline: a user uploads an image to S3, an upload event invokes Lambda, and the image is resized, stored in a destination bucket, and announced through SNS email. The graph preserves those documented stages and the Lambda execution permissions. Relationships are documented in the README; no source excerpts were available to verify implementation details beyond it.

Main entry points: [`CreateThumbnail.zip`](https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/CreateThumbnail.zip) (Thumbnail handler), [`s3-bucket.tf`](https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/s3-bucket.tf) (Source bucket), [`iam-policy.tf`](https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/iam-policy.tf) (Access policy), [`lambda-function.tf`](https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/lambda-function.tf) (AWS Lambda)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storage["Image storage"]
  node_source_bucket[("Source bucket<br/>[s3-bucket.tf]")]
  node_destination_bucket[("Destination bucket<br/>[s3-bucket.tf]")]
end

subgraph group_processing["Image processing"]
  node_lambda_service["AWS Lambda<br/>[lambda-function.tf]"]
  node_thumbnail_code["Thumbnail handler"]
end

subgraph group_notifications["Notifications and access"]
  node_sns_topic["SNS topic<br/>[sns-topic.tf]"]
  node_execution_role["Lambda execution role<br/>[iam-role.tf]"]
  node_execution_policy["Access policy<br/>[iam-policy.tf]"]
end

node_uploader(("Image uploader"))
node_email_subscriber(("Email subscriber"))

node_uploader -->|"uploads image"| node_source_bucket
node_source_bucket -->|"triggers on upload"| node_lambda_service
node_lambda_service -->|"runs handler"| node_thumbnail_code
node_thumbnail_code -->|"downloads original"| node_source_bucket
node_thumbnail_code -->|"stores thumbnail"| node_destination_bucket
node_thumbnail_code -->|"publishes result"| node_sns_topic
node_sns_topic -->|"sends notification"| node_email_subscriber
node_lambda_service -->|"uses role"| node_execution_role
node_execution_policy -->|"grants read access"| node_source_bucket
node_execution_policy -->|"grants write access"| node_destination_bucket
node_execution_policy -->|"grants publish access"| node_sns_topic

click node_source_bucket "https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/s3-bucket.tf"
click node_lambda_service "https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/lambda-function.tf"
click node_thumbnail_code "https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/CreateThumbnail.zip"
click node_destination_bucket "https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/s3-bucket.tf"
click node_sns_topic "https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/sns-topic.tf"
click node_execution_role "https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/iam-role.tf"
click node_execution_policy "https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/iam-policy.tf"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_source_bucket,node_destination_bucket toneBlue
class node_lambda_service,node_thumbnail_code toneAmber
class node_sns_topic,node_execution_role,node_execution_policy toneMint
class node_uploader,node_email_subscriber toneIndigo
```

## Components

### Image storage

- [Source bucket](https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/s3-bucket.tf): `s3-bucket.tf`
- [Destination bucket](https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/s3-bucket.tf): `s3-bucket.tf`

### Image processing

- [AWS Lambda](https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/lambda-function.tf): `lambda-function.tf`
- [Thumbnail handler](https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/CreateThumbnail.zip): `CreateThumbnail.zip`

### Notifications and access

- [SNS topic](https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/sns-topic.tf): `sns-topic.tf`
- [Lambda execution role](https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/iam-role.tf): `iam-role.tf`
- [Access policy](https://github.com/dkgit2/image-resizing-project-on-aws/blob/main/iam-policy.tf): `iam-policy.tf`

### Other components

- **Image uploader**
- **Email subscriber**

## Connections

- Image uploader → Source bucket: uploads image (evidence: `README.md`)
- Source bucket → AWS Lambda: triggers on upload (evidence: `README.md`)
- AWS Lambda → Thumbnail handler: runs handler (evidence: `README.md`)
- Thumbnail handler → Source bucket: downloads original (evidence: `README.md`)
- Thumbnail handler → Destination bucket: stores thumbnail (evidence: `README.md`)
- Thumbnail handler → SNS topic: publishes result (evidence: `README.md`)
- SNS topic → Email subscriber: sends notification (evidence: `README.md`)
- AWS Lambda → Lambda execution role: uses role (evidence: `README.md`)
- Access policy → Source bucket: grants read access (evidence: `README.md`)
- Access policy → Destination bucket: grants write access (evidence: `README.md`)
- Access policy → SNS topic: grants publish access (evidence: `README.md`)
