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

> Architecture diagram of the GitHub repository ritesh696/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/ritesh696/image-resizing-project-on-aws
- Repository: https://github.com/ritesh696/image-resizing-project-on-aws

## Overview

This Terraform project provisions a serverless image-resizing workflow: a user uploads an image to S3, an upload event invokes Lambda, and the function resizes the image, saves the result to another S3 bucket, and publishes a completion notification through SNS to an email subscriber. IAM roles and policies grant the function its required access. The README documents these relationships; no source excerpts were available, so the graph does not assert additional implementation details.

Main entry points: [`CreateThumbnail.zip`](https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/CreateThumbnail.zip) (Resize handler), [`lambda-function.tf`](https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/lambda-function.tf) (Lambda function), [`s3-bucket.tf`](https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/s3-bucket.tf) (Source bucket), [`sns-topic.tf`](https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/sns-topic.tf) (SNS topic)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_processing["Image processing"]
  node_lambda["Lambda function<br/>[lambda-function.tf]"]
  node_handler["Resize handler"]
end

subgraph group_notifications["Notifications"]
  node_topic["SNS topic<br/>[sns-topic.tf]"]
  node_subscriber["Email subscriber<br/>[sns-topic.tf]"]
end

subgraph group_access["Access control"]
  node_role["Execution role<br/>[iam-role.tf]"]
  node_policy["Access policies<br/>[iam-policy.tf]"]
end

node_user(("Image uploader"))

node_user -->|"uploads image"| node_source
node_source -->|"triggers on upload"| node_lambda
node_lambda -->|"runs handler"| node_handler
node_handler -->|"downloads original"| node_source
node_handler -->|"stores resized image"| node_destination
node_handler -->|"publishes result"| node_topic
node_topic -->|"emails notification"| node_subscriber
node_role -->|"grants access"| node_policy
node_lambda -->|"uses execution role"| node_role

click node_source "https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/s3-bucket.tf"
click node_destination "https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/s3-bucket.tf"
click node_lambda "https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/lambda-function.tf"
click node_handler "https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/CreateThumbnail.zip"
click node_role "https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/iam-role.tf"
click node_policy "https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/iam-policy.tf"
click node_topic "https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/sns-topic.tf"
click node_subscriber "https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/sns-topic.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,node_destination toneBlue
class node_lambda,node_handler toneAmber
class node_topic,node_subscriber toneMint
class node_role,node_policy toneRose
class node_user toneIndigo
```

## Components

### Image storage

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

### Image processing

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

### Notifications

- [SNS topic](https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/sns-topic.tf): `sns-topic.tf`
- [Email subscriber](https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/sns-topic.tf): `sns-topic.tf`

### Access control

- [Execution role](https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/iam-role.tf): `iam-role.tf`
- [Access policies](https://github.com/ritesh696/image-resizing-project-on-aws/blob/main/iam-policy.tf): `iam-policy.tf`

### Other components

- **Image uploader**

## Connections

- Image uploader → Source bucket: uploads image (evidence: `README.md`)
- Source bucket → Lambda function: triggers on upload (evidence: `README.md`)
- Lambda function → Resize handler: runs handler (evidence: `README.md`)
- Resize handler → Source bucket: downloads original (evidence: `README.md`)
- Resize handler → Destination bucket: stores resized image (evidence: `README.md`)
- Resize handler → SNS topic: publishes result (evidence: `README.md`)
- SNS topic → Email subscriber: emails notification (evidence: `README.md`)
- Execution role → Access policies: grants access (evidence: `README.md`)
- Lambda function → Execution role: uses execution role (evidence: `README.md`)
