It’s hard to believe, but after 10 years at Amazon AWS and even more at Heroku, I’ve moved the entire hawkimedia.com infrastructure to Cloudflare: website, blog, everything!
It all happened in less than five days, and it wouldn’t have happened without AI.
Why the change?
An update recently to one of our iOS apps required updating the website with new screenshots, copy, etc. I was quickly reminded of several things:
- The old site used Ruby on Rails. Back in 2009, that was a good choice. I knew that tech. It ran just fine. But at this point it was using outdated gems and running on an oudated Heroku build pack. It was quite long in the tooth, as some might say.
- Updating the site was reliably difficult because invariably something was amiss with the gems, the tooling, or the build pack at Heroku.
- To continue using Heroku would have meant hours of updating the website Rails implementation to something a more current Heroku build pack would support. None of this is straightforward, especially when the environments are not your day-to-day tech stack.
- Finally, with Heroku transitioning to sustaining engineering it didn’t seem like sticking with Heroku as a platform provider was a good choice anymore, or necessary for my needs.
Ten+ years though, at one provider, is a pretty good run though!
Enter AI
My workflow for solving complex problems (of all kinds) lately leans towards using AI (at least initially) more and more. I had been thinking for some time about possible alternatives to Heroku (as well as for AWS for this blog). I had no strong ideas about what to move to other than the possibility of a static website. Both the main website and the blog don’t change much. And when a change is necessary, being able to make that change quickly and without a fuss is most important these days. So asked Codex!
My prompt provided a fair bit of detail and constraints which were essentially:
- Take a look at the old website
- I said what the tech was and where it was hosted
- I described the content (very static, rarely needing updates)
- I called out the blog link as separate WordPress site
- I described the content and the frequency with which I create it (infrequently of late, but I hope that changes now!)
- I described my desire/hope to combine these two old sites into one.
- Finally I said
- Help me identify my optopns
- Ask me clarifying questions as needed
Very quickly Codex produced a cogent recommendation of Cloudflare Pages to host the site, and Hugo as the system through which to build and render the static content.
Honestly, I’d not heard of Pages or Hugo. (Cloudflare, yes; who hasn’t?) I decided to go for it, letting Codex do pretty much all the work. A plan was presented and we were off and running.
Codex provided a design and an initial prototype over which I iterated with Codex to get it looking good. Using both text and annotated images it was pretty easy to have Codex make every adjustment I wanted.
The website content was pretty easy for Codex to scrape and replicate. Certain image assets were updated or removed as appropriate for the new design and layout. In short order “we” were at a good place to checkpoint the work and move on.
The remaining piece was the blog. The old WordPress site was hosted at Amazon AWS on a small EC2 instance. That instance was also outdated, needing a major Ubuntu update. I’ve updated EC2 instances’ releases before and it has always worked, but I really just wanted to unburden myself of that administrative problem.
Unfortunately, I was unable to access the WordPress site efficiently or reliably to export the data. Luckily though, the site was backed up regularly to Amazon S3. And this is where AI really saved the day.
The backups contained a full SQL dump of every WordPress table, as well as all the uploaded media (think screen shots and the like). A real treasure trove! Armed with this data, Codex was able to extract every post, every piece of embedded media, tags and categories and more. Amazing! Codex churned away at this for a good 15 minutes. If you’ve used AI at all for tasks like this, I think you’d agree that 15 mninutes is a long time for AI to work on anything! So I think this hints at the complexity of the problem and suggests the enormity of the effort to have done this by hand.
Among the things Codex did was to remove WordPress shortcodes from posts (and other WordPress-y stuff). WordPress shortcodes appear inline in posts within square brackets, e.g. [code lang=objc]...[/code]. When Codex had fininshed extracting the old posts, a review of its work revealed a critical flaw: In addition to removing WordPress shortcodes, Codex had also removed a lot of text that was Objective-C code! If you know Objective-C you know it too uses square-bracket heavy syntax, e.g. [self doSomething];. I discovered a lot of code looking like
if (condition) {
;
;
;
}
Not good! But here is where AI really shined. I let Codex know what was happening with a very detailed prompt, noting that Objective-C makes heavy use of brakcets too and so it had been too aggressive when removing WordPress shortcodes. Codex gave me it’s version of “You’re absolutely right!” but then set about to re-examine all the articles that used the [code ...] shortcode and repaired all the new article files. Again, this is a task that to do manually would have taken a long time and been very tedius.
When all was said and done, over the course of a few days, the sites were migrated and combined into what you see today. I could hardly believe it. Using AI had not only saved time, but completely unblocked me from work that I knew needed to be done but surely would never have found the time to do.
The Wins, Enumerated
Consolidated services
- Heroku dependence eliminated
- No more Rails, Ruby, build packs, third-party monitoring, etc
- Amazon AWS dependence eliminated
- No more overkill infrastucture
Easy up-keep
- The website is just a private Github repo. It’s all just text!
- Creating content is as easy as creating a new Markdown file.
- Pushing updates triggers Cloudflare to just rebuild the site.
Zero cost
This is really the best part. Before I was paying about $50 monthly for Heroku and AWS.
Moving to Cloudflare Pages reduced that cost to zero (for me; they of course have much more robust plans and add-ons that cost real money). Plus, I get all the benefits of Cloudflare’s infrastructure, security, and more.
Using Cloudflare it also made sense to move my DNS for Hawk iMedia to Cloudflare as well. I had hosted that elsewhere for years. And finally, I decided I’d move the ICANN registration to Cloudflare too. Because: Why not? In total, that reduced my yearly domain cost by about $40. Small change, but not nothing either.
Postscript
This worked out so well that I decided to move another domain and website to Cloudflare Pages, similarly consolidating services and re-building the site using Hugo. More savings. More simplicity. AI took care of this one in about 2 hours.
AI is a powerful tool, for sure. Clearly, using it wisely can be a huge time saver. And that is exactly how we should be using it: wisely.