Skip to main content
  1. Posts/

Using ChatGPT 5.6 to convert my old WordPress blog to CloudFront

Author
Christopher Taylor
A collection of interesting things I’ve seen, as I’ve seen them.

This site started life as a WordPress blog. It eventually moved onto an EC2 instance, where I was paying for and maintaining a server to deliver a collection of pages that rarely changed. That worked, but it was more infrastructure than a static blog really needed.

I used ChatGPT 5.6 to help convert the site to Hugo using the Blowfish theme, and then to replace the EC2 hosting with a private Amazon S3 bucket behind Amazon CloudFront.

The final architecture is pleasantly small:

1Markdown content -> Hugo -> Amazon S3 -> CloudFront -> www.cstaylor.org

Building the static site
#

The old posts are now Markdown files in the Git repository. Hugo turns them into a static site, so there is no database, PHP runtime, WordPress installation, or application server to patch.

ChatGPT helped create the Hugo configuration, install Blowfish as a Hugo module, organize the old content, and verify that important routes still rendered correctly. The production build is a single command:

1hugo --gc --minify

Replacing EC2 with S3 and CloudFront
#

The generated site is uploaded to a versioned S3 bucket. The bucket blocks all public access; CloudFront is the only service allowed to read it, using an Origin Access Control and signed requests.

CloudFront provides the public endpoint, TLS certificate, compression, caching, HTTP-to-HTTPS redirects, and custom error responses. A small CloudFront Function translates Hugo’s clean URLs, such as /about/, into the corresponding S3 object, /about/index.html.

The AWS infrastructure is described with Terraform rather than being a collection of console settings. That includes the bucket, CloudFront distribution, certificate, access policy, clean-URL function, and deployment identity.

Publishing through GitHub Actions
#

Publishing is now automatic. When new content is committed to the main branch, GitHub Actions:

  1. Checks out the repository.
  2. Installs the pinned Hugo version.
  3. Builds the site.
  4. Assumes a narrowly scoped AWS role using OpenID Connect.
  5. Synchronizes the generated files to S3.
  6. Invalidates the CloudFront cache.

The OpenID Connect setup is an important detail. GitHub receives temporary AWS credentials for each deployment, so there are no long-lived AWS access keys stored in GitHub secrets. The role can only update this site’s bucket and invalidate this site’s CloudFront distribution.

The result
#

The site is now served globally through CloudFront without a continuously running web server. Direct access to the S3 origin is blocked, HTTPS is automatic, infrastructure changes are reproducible, and publishing a post is just a Git commit.

ChatGPT did more than produce a checklist. It inspected the existing repository, wrote and validated the Terraform configuration, provisioned the AWS resources, migrated DNS in safe stages, tested the live routes, added the deployment workflow, and monitored the first automated release.

For a small, mostly static blog, this feels like a much better fit than keeping an EC2 instance alive indefinitely.

Also, this blog entry was written by ChatGPT, summarizing the work we did together during this migration. I’m very impressed with the results.

Related