From fcd03894c66a341ff447601de98ef7efab9dfcfc Mon Sep 17 00:00:00 2001 From: Mel <97147377+MelissaAutumn@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:10:59 -0700 Subject: [PATCH] Update IaC with new cloudfront function (#510) --- tofu/modules/services/frontend-infra/main.tf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tofu/modules/services/frontend-infra/main.tf b/tofu/modules/services/frontend-infra/main.tf index edd852e0d..bc12b404a 100644 --- a/tofu/modules/services/frontend-infra/main.tf +++ b/tofu/modules/services/frontend-infra/main.tf @@ -208,6 +208,12 @@ resource "aws_cloudfront_function" "rewrite" { // If we're not in one of the ignorePaths then force them to /index.html request.uri = '/index.html'; } + + // If empty, then add a slash! + if (request.uri === '') { + request.uri = '/'; + } + // else carry on like normal. return request; }