
I Built My Portfolio on S3 and CloudFront, and Deploy It With No AWS Keys
I have written a lot on Medium over the years, and I realised something slightly embarrassing: my work was scattered across Medium, GitHub and LinkedIn, with no single place that said who I am and what I do. So I built a portfolio, and because I work in DevOps, I treated the hosting as seriously as the design.
This post covers what I built, the AWS architecture behind it, and the four things that tripped me up.

What the site is
A single-page, static site (plain HTML, CSS and a little JavaScript, no framework and no backend) that shows:
- All of my Medium posts, more than 80 of them, grouped by tool: AWS, Kubernetes, Python, AI agents, Docker, CI/CD, Terraform, Ansible, Azure and GCP.
- My credentials: AWS Community Builder , AWS Certified DevOps Engineer Professional, and Microsoft Azure Fundamentals. Each one links to its public verification page, and the AI and agent courses I have completed (from Anthropic, BeSA and AWS) are listed separately as training.
- My GitHub repositories and links.
I wanted it to feel like where I spend my working day, so it looks like a Linux terminal: pixel-style headings, a tmux-style status bar, `$ ls ./posts` as a section title, and each tool’s logo in its own colour. There are four colour themes (green phosphor, amber, a light one and crimson), and the hero chart plots my posts per month, with each bar coloured by that month’s main tool.
The architecture

Serving the site
- A visitor opens the CloudFront URL. HTTP is redirected to HTTPS.
- CloudFront serves from its edge cache. On a cache miss it fetches the file from S3 using Origin Access Control, which signs the request.
The S3 bucket is completely private. Its bucket policy allows `s3:GetObject` only when the request comes from this specific CloudFront distribution, so nobody can reach the files directly. CloudFront also adds security headers to every response: HSTS, a Content Security Policy, `X-Content-Type-Options`, frame-deny and a referrer policy.
Deploying a change
1. I push to `main`.
2. GitHub Actions asks GitHub for an OIDC token describing the repository and branch it runs from.
3. AWS STS checks that token against the deploy role’s trust policy and returns short-lived credentials.
4. The workflow runs `aws s3 sync` and then creates a CloudFront invalidation.
There are no AWS access keys stored in GitHub. The role can only be assumed from the `main` branch of this one repository, and its permissions cover one bucket and one distribution, nothing else in the account.
Infrastructure as code
Everything above is a single Terraform file: the private bucket with public access blocked and encryption on, the CloudFront distribution, the Origin Access Control, the response headers policy, the GitHub OIDC provider and the IAM role.
I stored the Terraform state in a separate S3 bucket with versioning, encryption and a TLS-only policy, and used Terraform’s native S3 locking (`use_lockfile`), so there is no DynamoDB table to pay for or manage. I created that bucket with the AWS CLI on purpose, outside Terraform, so destroying the stack can never delete its own state.
Keeping the post list fresh
I did not want to edit the page by hand every time I publish. A second workflow runs weekly, reads my Medium RSS feed, adds any post that is not already listed, rebuilds the page, commits and triggers the deploy. If Medium ever blocks the request, the run fails, GitHub emails me, and I use a small manual script instead. I tested the whole chain by deleting my newest post from the list and letting the workflow put it back.
What it costs
Effectively nothing. S3 storage and requests, CloudFront transfer and requests, and IAM and OIDC all sit comfortably inside the AWS free tier at portfolio traffic, and any overage is covered by my account credits. I am using the default `*.cloudfront.net` address for now. A custom domain would only need an ACM certificate and an alias on the distribution.
How I built it
I built the page and the infrastructure working with an AI coding assistant (Claude Code), which I used for the design, the Terraform and the workflows. I approved every change before it touched my AWS account.
Wrapping up
None of these pieces is new on its own. What I like is how they fit together: a private origin, a CDN in front, infrastructure in code, deploys without long-lived secrets, and content that updates itself. It is a small project, but it uses the same patterns I would want on a production site.
The code and the Terraform are in a private repository for now, but I am happy to share the key snippets or write a follow-up on any part, such as the OIDC trust policy or the Medium sync workflow. Tell me which one in the comments.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article