Add a Rewrite instead of a Redirect for AWS Amplify + Terraform

When I deploy my React App on AWS amplify using the configuration given in the docs, in the custom rules configuration when I put

#main.tf
  custom_rule {
    source = "/<*>"
    status = "404"
    target = "/index.html"
  }

It automatically assumes that the custom rule is a 404 redirect. How do I make it a 404 rewrite? What configuration am I missing here?

According to the docs it should be “404-200”.

1 Like

That worked. Thank you :raised_hands: :smile: