IaC in Action: Deploying a Static Site with Pulumi, AWS & Cloudflare

This is a submission for the Pulumi Deploy and Document Challenge: Fast Static Website Deployment
What I Built
This project showcases how to deploy a static website from scratch using Pulumi with Python, Amazon S3 for website hosting, and Cloudflare for DNS and CDN.
The website, hosted at one-million.tech, was fully provisioned using infrastructure as code (IaC), enabling repeatable, automated, and version-controlled deployments.
Live Demo Link
Project Repo
Be sure to check out the README for a full step-by-step guide.
My Journey
I started this project with one primary goal in mind: to gain hands-on experience deploying infrastructure using Pulumi with Python, and to go beyond clicking buttons in the AWS console. I’d worked with static sites before, but this time, I wanted a clean, repeatable, automated way to manage the full lifecycle of a site, from code to cloud, using Infrastructure as Code (IaC).
The Initial Setup
I chose Pulumi because it lets me write infrastructure in Python(my language of choice). I created a new Pulumi project and began scaffolding the resources needed for hosting a static site:
An S3 bucket with static site configuration
Public access policies (but with care, to keep things secure)
Uploading local site files to S3 using Pulumi’s FileAsset
DNS setup using Cloudflare to point my custom domain one-million.tech to the S3-hosted site
That was the plan. Simple on paper. But cloud deployments are never as smooth as you’d think at first glance
I shared every challenge I encountered, from S3 bucket errors to DNS propagation pain, and how I resolved them. It’s packed with lessons, code snippets, and real dev struggles. How I Tamed the Cloud — Troubleshooting My S3, Cloudflare & Pulumi Static Site
Using Pulumi
Pulumi was the backbone of this project.
- I used the Python SDK to define and provision an S3 bucket configured for static site hosting.
- I added Cloudflare DNS configuration via Pulumi to route my custom domain (
one-million.tech
) to the S3 endpoint. - I uploaded static HTML files with correct types using Pulumi’s
FileAsset
. - I stored secrets and configs securely with
pulumi config
.
Why Pulumi?
- IaC with a real language (Python
)
- No manual setup or clicking through AWS/Cloudflare dashboards
- Version control + fast re-deployment
- Seamless integration of multiple cloud providers