October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Build a Blog with Terraform and AWS: The Learning Setup

A Terraform-powered static blog can teach cloud engineering by combining AWS infrastructure with automated GitHub Actions deployments. Here’s how the pieces work and what to verify.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Terraforming a blog is a practical way to learn cloud engineering: Terraform provisions the infrastructure, while GitHub Actions builds and publishes the site to AWS. Kishan Patel’s setup uses S3 for static files and Terraform state, CloudFront for delivery, ACM for TLS, Route 53 for DNS, IAM for permissions, and AWS Budgets for spending alerts. It is aimed at people who want to learn by building—not those who simply want a blog online with minimal setup.

What this Terraform blog setup is for

Patel describes a static-blog project as a hands-on learning exercise. It connects source control, infrastructure as code, cloud hosting, identity and deployment automation in one workflow. The project can teach how these pieces fit together, but the post is an account of one implementation, not a complete production blueprint.

As an Amazon Associate I earn from qualifying purchases.

The central division of work is straightforward: Terraform provisions and manages AWS resources; GitHub Actions builds the site and uploads the generated files. Visitors receive the static output through CloudFront rather than having a server render pages on demand.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How the components fit together

Component Role in Patel’s setup
GitHub Stores the project and triggers automated deployment through Actions.
Terraform Declares and provisions the AWS infrastructure.
Amazon S3 Stores the static site objects and, as described by Patel, Terraform state.
Amazon CloudFront Delivers site content to visitors and supports cache invalidation after deployment.
AWS Certificate Manager (ACM) Provides the TLS certificate used for HTTPS delivery.
Amazon Route 53 Handles DNS and domain routing.
AWS IAM Controls permissions for the people and automation that access AWS.
AWS Budgets Provides cost alerts; the post does not give a cost estimate or specific alert thresholds.

The post says local command-line access uses SSO for temporary credentials, while GitHub Actions uses OpenID Connect (OIDC) to obtain temporary AWS access. These are descriptions of Patel’s design; they do not establish that every permission, bucket policy, or state safeguard meets current best practice.

What happens when a change is deployed

  1. A change is pushed to the main branch.
  2. GitHub Actions runs npm run build, which the post says produces the static site in dist/.
  3. The workflow syncs the generated files to S3.
  4. The workflow looks up the CloudFront distribution and invalidates cached content so updated files can be served.

Patel says the configuration caches assets but not HTML, aiming to reduce the chance that visitors see stale pages. That is the behavior of this described setup, not a universal caching rule: cache policy should reflect how a particular site names, versions, and updates its files.

Security and infrastructure decisions to make deliberately

Keep the S3 origin private where possible

A site served from S3 through CloudFront is not automatically private or secure. The origin type and bucket policy matter. AWS’s secure static-site guidance describes using a CloudFront origin access control (OAC) with an S3 bucket origin, restricting direct bucket access while keeping S3 Block Public Access enabled. OAC applies to an S3 bucket origin, not an S3 website endpoint. S3 website endpoints support HTTP only, so the choice of origin affects how HTTPS and access control are configured.

For a custom domain, the TLS certificate and CloudFront configuration must also align with the chosen domain and distribution. Treat the bucket policy, origin type, certificate, DNS records, and delivery settings as a coordinated design rather than assuming that adding CloudFront alone makes a bucket private.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Protect Terraform state

Terraform state records infrastructure details and should be treated as sensitive operational data. AWS Prescriptive Guidance recommends remote state in S3, state locking, versioning, access controls, and separate backends for different environments. It identifies native S3 state locking as available starting with Terraform 1.10.0 and recommends it over the deprecated DynamoDB locking approach. See AWS guidance on Terraform backends.

Patel says S3 stores state, but the post does not establish whether his implementation uses locking, versioning, narrowly scoped access, or environment-separated backends. Those are implementation details to verify before using the project as a foundation for infrastructure you depend on.

Use temporary CI credentials and narrow permissions

AWS recommends GitHub Actions OIDC federation so workflows can receive temporary AWS credentials instead of relying on long-lived access keys. Patel describes using OIDC, but a secure setup also depends on restricting which repository and workflow can assume the IAM role and limiting that role to the required actions and resources. Do not put long-lived AWS keys in repository secrets as a shortcut.

Set cost expectations without guessing

The post warns that free-tier limits can be reached and additional usage can cost money, but it gives no numerical estimate. Actual charges depend on use and configuration. Budget alerts can help surface spending; they do not make the services free or necessarily stop them from incurring charges.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When this approach makes sense—and when it does not

  • Consider it if: you want to learn Terraform, AWS identity, static hosting, DNS, TLS, and automated deployments by connecting them in a real project.
  • Choose a lower-operations route if: your main goal is to publish quickly rather than learn how to manage the infrastructure. AWS’s S3 website-hosting documentation recommends Amplify Hosting for static content.
  • Plan for a different architecture if: the blog needs server-side rendering, dynamic application behavior, or other capabilities not covered by a static-file deployment.

Compare alternatives based on setup effort, ongoing operational responsibility, access-control configuration, visibility into costs, and whether dynamic behavior is required. Without a specified workload and like-for-like cost data, it is not possible to conclude that one option is cheaper or faster.

What the project leaves out

Patel explicitly does not cover security in depth or dynamic sites. His post also provides no formal cost estimate. The architecture is useful as a learning map, but readers should validate the actual Terraform code, IAM trust and permission policies, bucket configuration, state handling, and cache behavior before adapting it to a live site.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.