# gurjyot-gurz/aws-edge-secured-static-site architecture

> Architecture diagram of the GitHub repository gurjyot-gurz/aws-edge-secured-static-site, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gurjyot-gurz/aws-edge-secured-static-site
- Repository: https://github.com/gurjyot-gurz/aws-edge-secured-static-site

## Overview

This repository documents a static website delivered through CloudFront from S3, with Lambda@Edge adding security headers to viewer responses. The principal workflow is a browser request, CDN origin retrieval, edge response hardening, and delivery to the browser. The JavaScript also implements client-side terminal animation, section navigation, a live clock, and footer-year display. AWS wiring is described in the README rather than represented by infrastructure source files; frontend markup was not sampled, so its exact asset-loading links are not shown.

Main entry points: [`src/index.html`](https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/src/index.html) (Website Page), [`lambda_function.py`](https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/lambda_function.py) (Header Handler), [`src/styles.css`](https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/src/styles.css) (Page Styles), [`src/script.js`](https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/src/script.js) (Client Interactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Static Website"]
  node_html["Website Page<br/>[index.html]"]
  node_styles["Page Styles<br/>[styles.css]"]
  node_client["Client Interactions<br/>[script.js]"]
end

subgraph group_delivery["AWS Delivery"]
  node_cloudfront["CloudFront CDN"]
  node_s3[("S3 Static Origin")]
end

subgraph group_security["Edge Security"]
  node_edge["Header Handler<br/>[lambda_function.py]"]
end

node_browser(("Visitor Browser"))

node_browser -->|"requests content"| node_cloudfront
node_cloudfront -->|"fetches origin"| node_s3
node_s3 -->|"returns content"| node_cloudfront
node_cloudfront -->|"invokes on response"| node_edge
node_edge -->|"returns hardened response"| node_cloudfront
node_cloudfront -->|"delivers over HTTPS"| node_browser
node_html -.->|"hosts interactions"| node_client
node_html -.->|"uses styles"| node_styles

click node_html "https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/src/index.html"
click node_styles "https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/src/styles.css"
click node_client "https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/src/script.js"
click node_edge "https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/lambda_function.py"

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_html,node_styles,node_client,node_browser toneBlue
class node_cloudfront,node_s3 toneAmber
class node_edge toneMint
```

## Components

### Static Website

- [Website Page](https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/src/index.html): `src/index.html`
- [Page Styles](https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/src/styles.css): `src/styles.css`
- [Client Interactions](https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/src/script.js): `src/script.js`

### AWS Delivery

- **CloudFront CDN**
- **S3 Static Origin**

### Edge Security

- [Header Handler](https://github.com/gurjyot-gurz/aws-edge-secured-static-site/blob/main/lambda_function.py): `lambda_function.py`

### Other components

- **Visitor Browser**

## Connections

- Visitor Browser → CloudFront CDN: requests content
- CloudFront CDN → S3 Static Origin: fetches origin
- S3 Static Origin → CloudFront CDN: returns content
- CloudFront CDN → Header Handler: invokes on response
- Header Handler → CloudFront CDN: returns hardened response
- CloudFront CDN → Visitor Browser: delivers over HTTPS
- Website Page → Client Interactions: hosts interactions
- Website Page → Page Styles: uses styles
