prerender-cloudfront icon indicating copy to clipboard operation
prerender-cloudfront copied to clipboard

Does this work with AWS Amplify?

Open natarius opened this issue 5 years ago • 4 comments

We are hosting a React single page app via AWS Amplify and need to serve crawlers (like Google search crawlers) a pre-rendered version of each page for SEO reasons.

I came across this repo here and wonder if anyone knows how would I go about configuring AWS Amplify to use it?

Thanks

natarius avatar Nov 02 '20 21:11 natarius

Yes, a guide or some setup instructions would be really helpful.

daltonfury42 avatar Apr 16 '21 14:04 daltonfury42

We had the exact same problem to solve as you. Unfortunately, I ended up migrating the app off of Amplify onto our own Cloudfront/S3 distribution because Amplify does not support running Lambda@Edge lambdas. There are a few other lambda triggers within Amplify, but not any that are helpful for this use case. And there's no way to access the underlying Cloudfront distribution that Amplify is running.

justanotherjones avatar Apr 23 '21 21:04 justanotherjones

I just added the relevant bits of the CloudFormation template to the amplify/backend/hosting/S3AndCloudFront/template.json and that works fine.

We already had a lambda@edge function doing path rewrites/redirects, so we just added the relevant bits from this code to there as well.

berenddeboer avatar Oct 30 '21 07:10 berenddeboer

@berenddeboer is there any chance you could provide a more step-by-step of what you needed to do in Amplify to get this to work? We have a full Amplify Next.js site, but have not implemented an Amplify backend because we didn't need one.

wyckojr avatar Nov 30 '21 23:11 wyckojr