Host a serverless contact page using Amazon Cloudfront?

263 views Asked by At

I want to host a serverless contact page on Amazon Cloudfront.

I've followed this tutorial to the tee: Processing a Contact Form Using AWS Cloudfront...

There are many steps, but the most important things that I would like to highlight that I have done correctly:

  • I have set the AWS S3 bucket to public, and given public read access
  • My Cloudfront behavior allows the POST method (which I use in my HTML contact-form and corresponding js)
  • My Lambda function and my API Gateway send an e-mail to me (so I know that is working!)

Still, when I press submit on my actual website, I get this error:

This XML file does not appear to have any style information associated with it.

This XML file does not appear to have any style information associated with it.

Could anyone please suggest to me where I might be going wrong? The website contact form is here.

1

There are 1 answers

7
Chris Williams On

Under the assumption this is a website endpoint the following appears in the documentation.

Requests supported: Supports only GET and HEAD requests on objects

It looks as though this is not supported for static websites and instead will need to be worked around.