Creating a CloudFront + S3 static site in Terraform

Creating a simple static site using serverless computing. This was a project which would lend itself to Hugo, S3 and/or CloudFront. The site used to generate the content, the github repo for the project is Alex covers this step by step in his blog here:

To upload content additions that can be used is the local-exec to copy the site content in place from var.site_content (hugo public directory) to the destination s3 bucket:

# Upload content
resource "null_resource" "remove_and_upload_to_s3" {
  provisioner "local-exec" {
    command = "aws s3 sync --metadata-directive REPLACE --cache-control 'max-age=86400, public' ${var.site_content} s3://${}"

The cache control is set to 86400 seconds here. The github repo for this is