# Deploy your Hugo site on AWS with Terraform

> Host a Hugo static site on AWS for a few euros a month: S3, CloudFront, Route 53 and an ACM certificate, all deployed with Terraform.

2022-08-17 · AWS, Hugo, Terraform

Many of you have asked yourself the following question:

**How to set up a simple site at low cost with little (or no) maintenance?**

I went through this same question myself, and wanted to answer it through
this post.

In this post, we will see how to set up a static website with [Hugo](https://gohugo.io/)
on [AWS](https://aws.amazon.com/) using [Terraform](https://www.terraform.io/).

**Spoiler alert**: You will go behind the scenes of how this site is made.

**TL;TR**: For those who wish to deploy their infrastructures on AWS, here is the [repository GitHub](https://github.com/mehdilaruelle/terraform-aws-hugo-website)

<div class="notice warning" >
    <p class="notice-title">
        <span class="icon-notice baseline">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="126 76.5 300 300">
  <path d="M297.431 324.397v-34.255c0-3.245-2.344-5.95-5.358-5.95h-32.146c-3.014 0-5.358 2.705-5.358 5.95v34.255c0 3.245 2.344 5.95 5.358 5.95h32.146c3.014 0 5.358-2.705 5.358-5.95Zm-.335-67.428 3.014-82.753c0-1.081-.502-2.524-1.674-3.425-1.005-.902-2.512-1.983-4.019-1.983h-36.834c-1.507 0-3.014 1.081-4.019 1.983-1.172.901-1.674 2.704-1.674 3.786l2.846 82.392c0 2.344 2.512 4.146 5.693 4.146h30.975c3.013 0 5.525-1.803 5.692-4.146Zm-2.344-168.39L423.34 342.425c3.683 7.032 3.516 15.686-.335 22.717-3.85 7.031-10.883 11.358-18.417 11.358H147.413c-7.534 0-14.566-4.327-18.417-11.358-3.85-7.031-4.018-15.685-.335-22.716L257.248 88.578C260.93 81.188 268.13 76.5 276 76.5c7.87 0 15.069 4.688 18.752 12.08Z"/>
</svg>

        </span> Warning </p><p>The website has been updated and upgraded since then. For those of you who are curious, I invite you to take a look at <a href="https://mehdilaruelle.com/posts/2023/10/deploy-your-hugo-site-on-aws-with-terraform-v2/">the next chapter of this article</a></p></div>


## Prerequisites

To understand this post, you must:
- Have some knowledge of [AWS](https://aws.amazon.com/)
- Know Terraform and in particular [deploy on AWS with Terraform](https://learn.hashicorp.com/collections/terraform/aws-get-started)

To reproduce the example of this blog, you must:
- Have an [AWS account and credentials](https://learn.hashicorp.com/tutorials/terraform/aws-build?in=terraform/aws-get-started#prerequisites)
- Have a domain name
- Deploy the infrastructure on AWS with [Terraform](https://learn.hashicorp.com/collections/terraform/aws-get-started)

## The beginning: What do we need?

To resume our question:

**How to set up a simple site at low cost with little (or no) maintenance?**

For this we need:
- **Simple site**: is often [a static website](https://en.wikipedia.org/wiki/Static_web_page).
- **No maintenance**: brings us to the concept of [Serverless](https://aws.amazon.com/serverless/).
- **HTTPS**: For this, we first need a domain name and a certificate.
- **Low cost**: The goal is to pay 0 each month.

## 1st step: the choice

In our adventure, we need a **static website generator**
and a **static website host**.

### The static website generator

In this post we will see [Hugo](https://gohugo.io/) mainly to discover the product but there are
other products such as:
- [jekyll](https://jekyllrb.com/) based on Ruby
- [next.js](https://nextjs.org/) based on React applications
- And many more that you can find on [Jamstack](https://jamstack.org/generators/)

The purpose of this post is not to compare generators.

### The static website hosting

There are several solutions to host your static website for free,
for example:
- [GitHub Page](https://pages.github.com/) : I recommend
- [OVHCloud](https://www.ovhcloud.com/fr/web-hosting/) : Free after purchasing a domain name
- [Netlify](https://www.netlify.com/blog/2016/10/27/a-step-by-step-guide-deploying-a-static-site-or-single-page-app/) : The blog post explains it all.

Here, the choice of [AWS](https://aws.amazon.com/) was made because it is one of (if not the) most used cloud providers.
It is of course possible to do this on other Cloud Providers such as [GCP](https://console.cloud.google.com/), [Azure](https://azure.microsoft.com/), etc

## 2nd step: A static website on Amazon S3

To host a static website on AWS, we can use [Amazon S3](https://aws.amazon.com/s3) with
the [hosting a static website](https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html) feature.

This will yield the following schema (based on AWS's Paris region):
<img src="/hugo-website/starter.png" loading="lazy" decoding="async" width="366" height="366" alt="Architecture of a static site on AWS S3" class="left" />

**Advantage**:
- The architecture is simple

**Disadvantage**:
- No HTTPS. The [documentation is clear](https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html):
> Amazon S3 website endpoints do not support HTTPS. If you want to use HTTPS, you can use Amazon CloudFront to serve a static website hosted on Amazon S3.
- No custom domain name for your website unless the bucket name is the [same as your domain name](https://stackoverflow.com/questions/25667252/custom-domain-for-s3-bucket). Otherwise you will additionally need to [use Amazon Route 53](https://docs.aws.amazon.com/AmazonS3/latest/userguide/website-hosting-custom-domain-walkthrough.html)

**Pricing**:
- [Amazon S3](https://aws.amazon.com/s3/pricing/): $0.024/GB per month. It all depends on the size of your site (especially media content).
But free if you use the [AWS Free Tier](https://aws.amazon.com/free)

**Conclusion** : If having an HTTP website is enough for you, you can stop there and start using Hugo (go to step 4). Otherwise,
see you in the third step.

## Step 3: Setting up HTTPS

Putting an HTTPS on our site is more complex than it seems. Indeed, we must:
1. Have a domain name
2. Have a certificate for the usage of HTTPS
3. [Amazon CloudFront](https://aws.amazon.com/cloudfront/) to activate the HTTPS

### Setting up the domain name

2 choices are available to you:
- Use Amazon Route 53: which simplifies our configuration both for certificate generation (for HTTPS) and Amazon Cloudfront configuration.
[0.50$ per month](https://aws.amazon.com/route53/pricing/) for the creation of a [public hosted zones on Amazon Route 53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html).
- **Do not** use Amazon Route 53: It is possible to not use Amazon Route 53 for [configuring Amazon CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html)
and [to create the certificate](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html). The action will require more effort and manual action.

<div class="notice info" >
    <p class="notice-title">
        <span class="icon-notice baseline">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="92 59.5 300 300">
  <path d="M292 303.25V272c0-3.516-2.734-6.25-6.25-6.25H267v-100c0-3.516-2.734-6.25-6.25-6.25h-62.5c-3.516 0-6.25 2.734-6.25 6.25V197c0 3.516 2.734 6.25 6.25 6.25H217v62.5h-18.75c-3.516 0-6.25 2.734-6.25 6.25v31.25c0 3.516 2.734 6.25 6.25 6.25h87.5c3.516 0 6.25-2.734 6.25-6.25Zm-25-175V97c0-3.516-2.734-6.25-6.25-6.25h-37.5c-3.516 0-6.25 2.734-6.25 6.25v31.25c0 3.516 2.734 6.25 6.25 6.25h37.5c3.516 0 6.25-2.734 6.25-6.25Zm125 81.25c0 82.813-67.188 150-150 150-82.813 0-150-67.188-150-150 0-82.813 67.188-150 150-150 82.813 0 150 67.188 150 150Z"/>
</svg>

        </span> Info </p><p>For my part, I use <a href="https://www.ovhcloud.com/en/domains/">OVHcloud domain</a> for hosting my root domain name (mehdilaruelle.ninja) and
a <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html">public hosted zones on Amazon Route 53</a> for my
subdomain (blog.mehdilaruelle.ninja). In my case, I chose Route 53 for my subdomain for simplicity.</p></div>


In our case, Amazon Route 53 is used. Our Terraform does not create the hosted zone (because it depends on where your domain name is located), so you will have to create and configure it.

<div class="notice note" >
    <p class="notice-title">
        <span class="icon-notice baseline">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 128 300 300">
  <path d="M150 128c82.813 0 150 67.188 150 150 0 82.813-67.188 150-150 150C67.187 428 0 360.812 0 278c0-82.813 67.188-150 150-150Zm25 243.555v-37.11c0-3.515-2.734-6.445-6.055-6.445h-37.5c-3.515 0-6.445 2.93-6.445 6.445v37.11c0 3.515 2.93 6.445 6.445 6.445h37.5c3.32 0 6.055-2.93 6.055-6.445Zm-.39-67.188 3.515-121.289c0-1.367-.586-2.734-1.953-3.516-1.172-.976-2.93-1.562-4.688-1.562h-42.968c-1.758 0-3.516.586-4.688 1.563-1.367.78-1.953 2.148-1.953 3.515l3.32 121.29c0 2.734 2.93 4.882 6.64 4.882h36.134c3.515 0 6.445-2.148 6.64-4.883Z"/>
</svg>

        </span> Note </p><p>To do: <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/migrate-dns-domain-in-use.html">Create the public hosted zone on Amazon Route 53</a></p></div>


### Setting up the certificate

For the certificate, we use [AWS Certificate Manager (ACM)](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html).
The advantage of ACM is to be able to [renew our certificates automatically](https://docs.aws.amazon.com/acm/latest/userguide/managed-renewal.html) and
will be used for the HTTPS on Amazon CloudFront.

**Pricing** :
- [ACM](https://aws.amazon.com/certificate-manager/pricing/): As we use a public certificate, the use of ACM is free.

In our case, our Terraform does not create the certificate because it takes a little time to issue it, which can fail our Terraform execution, so we will have to create the certificate manually.

<div class="notice warning" >
    <p class="notice-title">
        <span class="icon-notice baseline">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="126 76.5 300 300">
  <path d="M297.431 324.397v-34.255c0-3.245-2.344-5.95-5.358-5.95h-32.146c-3.014 0-5.358 2.705-5.358 5.95v34.255c0 3.245 2.344 5.95 5.358 5.95h32.146c3.014 0 5.358-2.705 5.358-5.95Zm-.335-67.428 3.014-82.753c0-1.081-.502-2.524-1.674-3.425-1.005-.902-2.512-1.983-4.019-1.983h-36.834c-1.507 0-3.014 1.081-4.019 1.983-1.172.901-1.674 2.704-1.674 3.786l2.846 82.392c0 2.344 2.512 4.146 5.693 4.146h30.975c3.013 0 5.525-1.803 5.692-4.146Zm-2.344-168.39L423.34 342.425c3.683 7.032 3.516 15.686-.335 22.717-3.85 7.031-10.883 11.358-18.417 11.358H147.413c-7.534 0-14.566-4.327-18.417-11.358-3.85-7.031-4.018-15.685-.335-22.716L257.248 88.578C260.93 81.188 268.13 76.5 276 76.5c7.87 0 15.069 4.688 18.752 12.08Z"/>
</svg>

        </span> Warning </p><p>The certificate must be created in <strong>North Virginia (us-east-1)</strong> because <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cnames-and-https-requirements.html#https-requirements-certificate-issuer">Amazon CloudFront only uses certificates in this region</a>.
Consider changing regions to <strong>N. Virginia (us-east-1)</strong></p></div>


<div class="notice note" >
    <p class="notice-title">
        <span class="icon-notice baseline">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 128 300 300">
  <path d="M150 128c82.813 0 150 67.188 150 150 0 82.813-67.188 150-150 150C67.187 428 0 360.812 0 278c0-82.813 67.188-150 150-150Zm25 243.555v-37.11c0-3.515-2.734-6.445-6.055-6.445h-37.5c-3.515 0-6.445 2.93-6.445 6.445v37.11c0 3.515 2.93 6.445 6.445 6.445h37.5c3.32 0 6.055-2.93 6.055-6.445Zm-.39-67.188 3.515-121.289c0-1.367-.586-2.734-1.953-3.516-1.172-.976-2.93-1.562-4.688-1.562h-42.968c-1.758 0-3.516.586-4.688 1.563-1.367.78-1.953 2.148-1.953 3.515l3.32 121.29c0 2.734 2.93 4.882 6.64 4.882h36.134c3.515 0 6.445-2.148 6.64-4.883Z"/>
</svg>

        </span> Note </p><p>To do: <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html">Create the public certificate on ACM in N. Virginia (us-east-1)</a></p></div>


### Setting up our CloudFront distribution

Once the domain name and certificate are ready, we can start deploying our infrastructure via Terraform.

The infrastructure should look like this:
<img src="/hugo-website/hugo_aws_website_hu_a5903c063b048d1d.webp" loading="lazy" decoding="async" srcset="/hugo-website/hugo_aws_website_hu_86e155cbbe840961.webp 480w, /hugo-website/hugo_aws_website_hu_a5903c063b048d1d.webp 732w" sizes="(max-width: 800px) 100vw, 800px" width="732" height="441" alt="Architecture of a static site on AWS S3 behind CloudFront" class="left" />

<div class="notice warning" >
    <p class="notice-title">
        <span class="icon-notice baseline">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="126 76.5 300 300">
  <path d="M297.431 324.397v-34.255c0-3.245-2.344-5.95-5.358-5.95h-32.146c-3.014 0-5.358 2.705-5.358 5.95v34.255c0 3.245 2.344 5.95 5.358 5.95h32.146c3.014 0 5.358-2.705 5.358-5.95Zm-.335-67.428 3.014-82.753c0-1.081-.502-2.524-1.674-3.425-1.005-.902-2.512-1.983-4.019-1.983h-36.834c-1.507 0-3.014 1.081-4.019 1.983-1.172.901-1.674 2.704-1.674 3.786l2.846 82.392c0 2.344 2.512 4.146 5.693 4.146h30.975c3.013 0 5.525-1.803 5.692-4.146Zm-2.344-168.39L423.34 342.425c3.683 7.032 3.516 15.686-.335 22.717-3.85 7.031-10.883 11.358-18.417 11.358H147.413c-7.534 0-14.566-4.327-18.417-11.358-3.85-7.031-4.018-15.685-.335-22.716L257.248 88.578C260.93 81.188 268.13 76.5 276 76.5c7.87 0 15.069 4.688 18.752 12.08Z"/>
</svg>

        </span> Warning </p><p>CloudFront can only be created in <strong>North Virginia (us-east-1)</strong>.</p></div>


On the [GitHub repository](https://github.com/mehdilaruelle/terraform-aws-hugo-website), add a `terraform.tfvars` file with
the following variables and values:
- `bucket_name` : is the s3 bucket that will be created
- `dns_name` : will be the domain name used via Route 53

<div class="notice note" >
    <p class="notice-title">
        <span class="icon-notice baseline">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 128 300 300">
  <path d="M150 128c82.813 0 150 67.188 150 150 0 82.813-67.188 150-150 150C67.187 428 0 360.812 0 278c0-82.813 67.188-150 150-150Zm25 243.555v-37.11c0-3.515-2.734-6.445-6.055-6.445h-37.5c-3.515 0-6.445 2.93-6.445 6.445v37.11c0 3.515 2.93 6.445 6.445 6.445h37.5c3.32 0 6.055-2.93 6.055-6.445Zm-.39-67.188 3.515-121.289c0-1.367-.586-2.734-1.953-3.516-1.172-.976-2.93-1.562-4.688-1.562h-42.968c-1.758 0-3.516.586-4.688 1.563-1.367.78-1.953 2.148-1.953 3.515l3.32 121.29c0 2.734 2.93 4.882 6.64 4.882h36.134c3.515 0 6.445-2.148 6.64-4.883Z"/>
</svg>

        </span> Note </p><p>To do: Change the contents of the <code>backend.tf</code> file with the configuration of your own Terraform backend</p></div>


Once the GIT repository is ready, run your commands (check your AWS credentials beforehand):
```bash
$ terraform init
$ terraform plan
$ terraform apply
```

The Terraform deploys:
- A **S3 bucket**: this S3 bucket will contain our static website.
The content thereof is private and accessible only by CloudFront via an [Origin Access Identity (OAI)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html).
In other words, our users will have to go through Amazon CloudFront and not directly on Amazon S3 to access our website.
- A **CloudFront distribution**: will allow us to use HTTPS on our website, to use a custom domain name, to set up a
[Content Delivery Network (CDN)](https://aws.amazon.com/cloudfront/) and
enhance security through the [AWS Shield service](https://aws.amazon.com/shield).

**Pricing** : 
- [Amazon CloudFront](https://aws.amazon.com/cloudfront/pricing/): this varies depending on the number of visitors to your site.
Around $0.08/GB for data transfer out per month from CloudFront.

#### Redirects case with CloudFront

The challenge encountered in this deployment is that some URLs in Hugo end this way: `my.website.com/posts/`.
To make it work, you need to implement a redirect that adds `index.html` at the end of the URL.
For example, if a user enters the following URL: `my.website.com/posts/` it turns into `my.website.com/posts/index.html`.

However, [CloudFront does not follow such redirects whether implemented by S3 or otherwise](https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-redirect-domain/).
To solve this, we add a [CloudFront function](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/example-function-add-index.html)
which will transform the URL at the CloudFront level as we want.

## 4th step: Deployment of our site via Hugo

At this stage, our infrastructure is ready to host our Hugo site.
I recommend you to use the [Hugo Quick Start](https://gohugo.io/getting-started/quick-start/) to get started with Hugo.

<div class="notice info" >
    <p class="notice-title">
        <span class="icon-notice baseline">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="92 59.5 300 300">
  <path d="M292 303.25V272c0-3.516-2.734-6.25-6.25-6.25H267v-100c0-3.516-2.734-6.25-6.25-6.25h-62.5c-3.516 0-6.25 2.734-6.25 6.25V197c0 3.516 2.734 6.25 6.25 6.25H217v62.5h-18.75c-3.516 0-6.25 2.734-6.25 6.25v31.25c0 3.516 2.734 6.25 6.25 6.25h87.5c3.516 0 6.25-2.734 6.25-6.25Zm-25-175V97c0-3.516-2.734-6.25-6.25-6.25h-37.5c-3.516 0-6.25 2.734-6.25 6.25v31.25c0 3.516 2.734 6.25 6.25 6.25h37.5c3.516 0 6.25-2.734 6.25-6.25Zm125 81.25c0 82.813-67.188 150-150 150-82.813 0-150-67.188-150-150 0-82.813 67.188-150 150-150 82.813 0 150 67.188 150 150Z"/>
</svg>

        </span> Info </p><p>On my side, I use the theme <a href="https://github.com/rhazdon/hugo-theme-hello-friend-ng">hello-friend-ng</a> and <a href="https://github.com/martignoni/hugo-notice">hugo-notice</a>.</p></div>


Once your first post has been written and your site has been built using Hugo, [you can deploy your site using Hugo](https://gohugo.io/hosting-and-deployment/hugo-deploy/).
Add in your `config.toml` the following section:
```toml
  [deployment]

  [[deployment.targets]]
    name = "aws"
    URL = "s3://hugo-website-mlaruelle?region=eu-west-3"
```

<div class="notice note" >
    <p class="notice-title">
        <span class="icon-notice baseline">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 128 300 300">
  <path d="M150 128c82.813 0 150 67.188 150 150 0 82.813-67.188 150-150 150C67.187 428 0 360.812 0 278c0-82.813 67.188-150 150-150Zm25 243.555v-37.11c0-3.515-2.734-6.445-6.055-6.445h-37.5c-3.515 0-6.445 2.93-6.445 6.445v37.11c0 3.515 2.93 6.445 6.445 6.445h37.5c3.32 0 6.055-2.93 6.055-6.445Zm-.39-67.188 3.515-121.289c0-1.367-.586-2.734-1.953-3.516-1.172-.976-2.93-1.562-4.688-1.562h-42.968c-1.758 0-3.516.586-4.688 1.563-1.367.78-1.953 2.148-1.953 3.515l3.32 121.29c0 2.734 2.93 4.882 6.64 4.882h36.134c3.515 0 6.445-2.148 6.64-4.883Z"/>
</svg>

        </span> Note </p><p>To do: Change the URL to your chosen S3 bucket name in your Terraform (used through the <code>bucket_name</code> variable)</p></div>


Once added, run the following command:
```bash
hugo deploy
```

And now, your website is deployed.

If you want to learn more about Hugo, you can find [several tutorials about it](https://kinsta.com/blog/hugo-static-site/).

## Feedback on my website experience

The method presented to you is used for this website.
Finally, what is the verdict after several years of use?

### Cost

The choice made is not the most optimized in terms of cost because I emphasized flexibility, simplicity and security.

The **annual total** is between $1 and $2. Add to that $6 if you use a [public hosted zones on Amazon Route 53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html). The costs do not include the annual price of a domain name, which varies.

<div class="notice info" >
    <p class="notice-title">
        <span class="icon-notice baseline">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="92 59.5 300 300">
  <path d="M292 303.25V272c0-3.516-2.734-6.25-6.25-6.25H267v-100c0-3.516-2.734-6.25-6.25-6.25h-62.5c-3.516 0-6.25 2.734-6.25 6.25V197c0 3.516 2.734 6.25 6.25 6.25H217v62.5h-18.75c-3.516 0-6.25 2.734-6.25 6.25v31.25c0 3.516 2.734 6.25 6.25 6.25h87.5c3.516 0 6.25-2.734 6.25-6.25Zm-25-175V97c0-3.516-2.734-6.25-6.25-6.25h-37.5c-3.516 0-6.25 2.734-6.25 6.25v31.25c0 3.516 2.734 6.25 6.25 6.25h37.5c3.516 0 6.25-2.734 6.25-6.25Zm125 81.25c0 82.813-67.188 150-150 150-82.813 0-150-67.188-150-150 0-82.813 67.188-150 150-150 82.813 0 150 67.188 150 150Z"/>
</svg>

        </span> Info </p><p>If you use the <a href="https://aws.amazon.com/free">AWS Free Tier</a>, it costs you $0.</p></div>
 

**Pricing summary**:
- [Amazon S3](https://aws.amazon.com/s3/pricing/): $0.024/GB per month. It all depends on the size of your site (especially media content).
- [Amazon Route 53](https://aws.amazon.com/route53/pricing/): [0.50$ per month](https://aws.amazon.com/route53/pricing/) for creating a [public hosted zones on Amazon Route 53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html)
- [ACM](https://aws.amazon.com/certificate-manager/pricing/): As we use a public certificate, using ACM is free.
- [Amazon CloudFront](https://aws.amazon.com/cloudfront/pricing/): This varies depending on the number of visitors to your site.
Around $0.08/GB for data transfer out per month from CloudFront.

### Maintenance

No maintenance apart from occasional updates to the themes.

### Conclusion

Hugo offers great flexibility for website creation at low cost (or free of charge) while staying simple.
Go for a free hosting solution and you will not be disappointed.

<div class="notice warning" >
    <p class="notice-title">
        <span class="icon-notice baseline">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="126 76.5 300 300">
  <path d="M297.431 324.397v-34.255c0-3.245-2.344-5.95-5.358-5.95h-32.146c-3.014 0-5.358 2.705-5.358 5.95v34.255c0 3.245 2.344 5.95 5.358 5.95h32.146c3.014 0 5.358-2.705 5.358-5.95Zm-.335-67.428 3.014-82.753c0-1.081-.502-2.524-1.674-3.425-1.005-.902-2.512-1.983-4.019-1.983h-36.834c-1.507 0-3.014 1.081-4.019 1.983-1.172.901-1.674 2.704-1.674 3.786l2.846 82.392c0 2.344 2.512 4.146 5.693 4.146h30.975c3.013 0 5.525-1.803 5.692-4.146Zm-2.344-168.39L423.34 342.425c3.683 7.032 3.516 15.686-.335 22.717-3.85 7.031-10.883 11.358-18.417 11.358H147.413c-7.534 0-14.566-4.327-18.417-11.358-3.85-7.031-4.018-15.685-.335-22.716L257.248 88.578C260.93 81.188 268.13 76.5 276 76.5c7.87 0 15.069 4.688 18.752 12.08Z"/>
</svg>

        </span> Warning </p><p>The website has been updated and upgraded since then. For those of you who are curious, I invite you to take a look at <a href="https://mehdilaruelle.com/posts/2023/10/deploy-your-hugo-site-on-aws-with-terraform-v2/">the next chapter of this article</a></p></div>

---

Originally published at https://mehdilaruelle.com/posts/2022/08/deploy-your-hugo-site-on-aws-with-terraform/
