DEV Community

Cover image for 💡How I Tamed the Cloud: Troubleshooting My S3 + Cloudflare + Pulumi Static Site
Fave😌✨
Fave😌✨

Posted on

3 1 1 1

💡How I Tamed the Cloud: Troubleshooting My S3 + Cloudflare + Pulumi Static Site

Troubleshooting My Static Website Deployment with S3, Cloudflare & Pulumi

Deploying a static website may seem simple at first glance, but behind the scenes lies a minefield of configuration details and cloud service quirks.

In this article, I'll walk through the key challenges I faced while deploying one-million.tech using Amazon S3, Cloudflare, and Pulumi and how I resolved each issue.


🛠️ The Goal

Build and deploy a static website to:


🚧 Common Pitfalls I Encountered (And Fixed)

1. S3 Endpoint URL Error

Problem: While connecting my domain name to the S3 bucket, I received this error:

"Not a valid S3 website endpoint"

Cause: I used the full URL instead of just the region endpoint.

Fix:
Use the correct format:

s3-website-us-east-1.amazonaws.com
Enter fullscreen mode Exit fullscreen mode

Avoid including the full bucket path or http:// prefix.


2. DNS Record Already Exists

Problem:

"A record with the specified name already exists"

Cause: I attempted to create a new A record in Cloudflare while one already existed for @ (root domain).

Fix:

  • Navigate to the DNS tab in Cloudflare.
  • Edit the existing record instead of creating a new one.

3. Pulumi Bucket Conflicts

Problem:
I wasn’t sure whether to delete an existing bucket used by Pulumi.

Fix:

  • Double-checked that the bucket wasn’t associated with any critical data.
  • Deleted the unused pulumi-deploy-bucket and redeployed with a new Pulumi configuration.

4. 404 Not Found Error on My Domain

Problem:
Once the nginx page disappeared, the domain showed a 404 error.

Cause: S3 bucket wasn’t properly configured for static website hosting and index.html was missing.

Fix:

  • Enabled "Static website hosting" in the bucket settings.
  • Uploaded index.html.
  • Specified index.html as the default root document.

5. Edits to index.html are Not Reflecting on the live site

Problem:
My changes to index.html were not showing up on the live site.

Cause: Cloudflare cached the old version of the site.

Fix:

  • Uploaded updated index.html to S3.
  • Went to Cloudflare > Caching > Purge Everything.

8. Secrets Detected in GitHub Commits

Problem:
GitHub flagged my commits:

"Secrets detected in recent commits"

Fix:

  • Added sensitive files like Pulumi.dev.yaml to .gitignore
  • Used git filter-branch to remove them from Git history:
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch Pulumi.dev.yaml" --prune-empty --tag-name-filter cat -- --all
git push origin --force --all
Enter fullscreen mode Exit fullscreen mode

troubleshooting

🎉 Final Result

After working through these issues, I successfully deployed my static site:
🔗 https://one-million.tech

Everything is now cached, secure (HTTPS), and fast — thanks to Cloudflare and S3.


💡 Lessons Learned

  • Always double-check AWS bucket configuration for website hosting.
  • Cloudflare DNS takes time — patience is key.
  • Pulumi’s automation is powerful but unforgiving with secrets.
  • Cache is the usual suspect when updates don’t show.

Stay tuned for my GitHub repo and portfolio write-up!


If you’re planning to deploy your own static site with Pulumi, AWS, and Cloudflare, save this guide. It might just save you a weekend of debugging!


Written by: Fave — DevOps & Cloud Engineer

Quadratic AI

Quadratic AI – The Spreadsheet with AI, Code, and Connections

  • AI-Powered Insights: Ask questions in plain English and get instant visualizations
  • Multi-Language Support: Seamlessly switch between Python, SQL, and JavaScript in one workspace
  • Zero Setup Required: Connect to databases or drag-and-drop files straight from your browser
  • Live Collaboration: Work together in real-time, no matter where your team is located
  • Beyond Formulas: Tackle complex analysis that traditional spreadsheets can't handle

Get started for free.

Watch The Demo 📊✨

Top comments (0)