amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

AWS Amplify and Lambda@Edge

Open fomson opened this issue 4 years ago • 15 comments

Which Category is your question related to? Hosting, Lambda Amplify CLI Version 4.24.3+

Can I add Lambda@Edge to my AWS Amplify app?

fomson avatar Jul 26 '20 23:07 fomson

https://github.com/aws-amplify/amplify-console/issues/412

fomson avatar Jul 26 '20 23:07 fomson

@FOMSON Thanks for the feature request we will take a look into. Any feedback on how you would like to use and create Lambda@Edge in Amplify CLI would be useful too

ammarkarachi avatar Jul 28 '20 15:07 ammarkarachi

@ammarkarachi Thank you for coming back to me.

Could this be implemented as part of amplify hosting update? Allow linking functions to different trigger events available with a standard CloudFront distribution? Perhaps, to meet Lambda@Edge limits and requirements, such functions should be created as part of amplify hosting update (or when amplify hosting add), and not by amplify function add?

May I ask how feasible this feature is to wait for? Otherwise, I will proceed with a workaround by using the S3 and CloudFront hosting option.

fomson avatar Jul 28 '20 17:07 fomson

@ammarkarachi - it would be great if lambda@edge functions were supported by the CLI. I'm in need of this support for SSR rendering static pages for SEO purposes. I noticed that most of the work to support this via the JS SDK has been kindly done by @ericclemmons. I've yet to see the status on actually deploying the infrastructure to support SSR, however.

kylekirkby avatar Sep 02 '20 14:09 kylekirkby

I to would love this feature :)

WillDelish avatar Oct 20 '20 23:10 WillDelish

im really need this feature in amplify.

amplify add function ? Select which capability you want to add:

Lambda Edge (Associated with Cloudfront). <--- new option

thanks

ccortezb avatar Nov 18 '20 23:11 ccortezb

im really need this feature in amplify.

amplify add function ? Select which capability you want to add:

Lambda Edge (Associated with Cloudfront). <--- new option

thanks

This would be a very useful feature. I have a Lambda function managed via Amplify and require a new numbered version for a CloudFront trigger. This process is managed outside of Amplify and is very cumbersome.

jdw88 avatar Feb 01 '21 13:02 jdw88

It's currently recommended to use the serverless/next-js component.

https://docs.amplify.aws/start/getting-started/hosting/q/integration/next

I've used this component and it works well. I hope the Amplify team can eventually add this functionality to the CLI, although quite a bit of work would be required. Maybe an amplify plugin should be created to seamlessly integrate Serverless Framework stacks into the Amplify CLI.

kylekirkby avatar Feb 01 '21 13:02 kylekirkby

Hi,

It would be very useful to add lambda@edge for the CloudFront hosting distribution. I thing the easier would be to implement it on amplify hosting add or amplify hosting update when it will ask you if you need a lambda edge. If so, you should let you choose which trigger you want (viewer request, origin request, origin response and viewer response) with a multiple selection option.

cornelcroi avatar Feb 13 '21 11:02 cornelcroi

Is there any update on a tool through amplify console to save our SEO?

vincent38wargnier avatar Apr 26 '21 14:04 vincent38wargnier

We're having to move our Amplify app to S3 so we can add a viewer request Lambda@Edge function to populate social open graph cards, unfurls etc. Would really LOVE to be able to use Amplify and add these functions to the app's seemingly hidden CloudFront distribution.

greenafrican avatar Feb 18 '22 12:02 greenafrican

Hi AWS people,

Can you provide any guidance on this please.?

We are also trying to use prerender.io to take care of serving statics pages to crawlers and bots. Their service loads and runs SPAs and caches the pages just like your client browser. These can then be quickly returned to crawlers that don't have to handle a full React SPA. This trick requires that the crawler is detected and the returned page comes from the prerender.io cache and not just the SPA loading.

Prerender.io support points to a github repo that uses lambda@edge functions to do this. But how do I associate these with our Amplify domain?

https://github.com/jinty/prerender-cloudfront

I have used other SPA hosting Meteor Galaxy, that just has a checkbox in the admin UI to enable/disable. This is something you could also add into Amplify Console - this would save a lot of SEO headaches

help appreciated Thanks

Tony-OAA avatar Jul 18 '22 14:07 Tony-OAA

Any update on this in 2023? I am also trying to serve up some HTML to crawlers and bots.

chrisninetyone avatar Apr 28 '23 16:04 chrisninetyone

+1 Really in need of lambda@edge in amplify application, make lot work easier.

With edge can set function, which transforms the incoming POST request to a GET request and passes the required payload parameter in the query string. Not finding this easy in amplify.

vcrego avatar May 19 '23 10:05 vcrego

+1

Need it for AWS Marketplace integration using transformation of POST to GET with url params etc.

electronicalias avatar Dec 28 '23 07:12 electronicalias