DEV Community

Cover image for IaC in Action: Deploying a Static Site with Pulumi, AWS & Cloudflare
Fave😌✨
Fave😌✨

Posted on

16 11 13 11 12

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

one-million.tech

website screenshot

website screenshot

📦Project Repo

🔗 https://github.com/onlyfave/Pulumi-deploy-static

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

AWS Security LIVE! Stream

Streaming live from AWS re:Inforce

Tune into Security LIVE! at re:Inforce for expert takes on modern security challenges.

Learn More

Top comments (10)

Collapse
 
pravesh_sudha_3c2b0c2b5e0 profile image
Pravesh Sudha

Great Blog, I have written for the same prompt, but I can clearly see your hardwork, Great work!

Collapse
 
onlyfave profile image
Fave😌✨

Thank you, Pravesh!

Collapse
 
nolunchbreaks_22 profile image
Osagie Anolu

Vamonos!!!! Good job

Collapse
 
onlyfave profile image
Fave😌✨

Thank you Osagie!😌

Collapse
 
josephine_essien_52bc4807 profile image
Josephine Essien

this is wholesome!.... 😍

Collapse
 
rebornay profile image
Dauda Samson

This is amazing, Favour. Well done.👏

Collapse
 
onlyfave profile image
Fave😌✨

Thank you, Sam!

Collapse
 
chiamaka_onyeneke_e9b05ad profile image
chiamaka onyeneke

Great article Fave😊

Collapse
 
josephine_essien_52bc4807 profile image
Josephine Essien

❤❤❤❤❤

Collapse
 
onlyfave profile image
Fave😌✨

😌❤️❤️❤️