aws / aws-lambda-go

Libraries, samples and tools to help Go developers develop AWS Lambda functions.
Apache License 2.0
3.61k stars 548 forks source link

Support for CloudFront Lambda@Edge #52

Open jabalsad opened 6 years ago

jabalsad commented 6 years ago

Hi,

I've been using the aws-lambda-go package for integrating API Gateway, S3, DynamoDB and Lambda. It's been great!

One integration I'm really interested in using is CloudFront (Lambda@Edge). It would be great if the request/response types are modeled already so that I don't have to write the boilerplate.

ref; https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-generating-http-responses.html

alexbilbie commented 6 years ago

Lambda@Edge only supports JavaScript Lambda functions

jabalsad commented 6 years ago

Well that's disappointing :-(

suneeta-mall commented 6 years ago

yeah not much fun!

You must create functions with the nodejs6.10 runtime property

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-requirements-limits.html

cemenson commented 5 years ago

Sad times - I made a url redirect function with custom structs as aws don't provide them only to find out golang doesn't work on lambda@edge.

Anyone heard of any developments on this?

rmasclef commented 5 years ago

Hi there, any news about Go support for Lambda@edge ?

1gm commented 5 years ago

Hi there, any news about Go support for Lambda@edge ?

Sadly, we still have nothing ):

See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-requirements-limits.html#lambda-requirements-lambda-function-configuration

nick-uk commented 4 years ago

I'm surprised this issue for such a long-time open... I just gave a try me too because Go offers ver short execution times and sounds ideal for lambda. So, I created custom CloudFront event structs because it doesn't exist in the SDK, then I deployed my function and I confirmed is working from the console by sending CloudFront test events. When I tried to attach it on a distribution I got an error that "go1.x" execution environment is not supported only nodejs and python3.7. Be aware of "Viewer request" based events there is a function bundle size limit of 1MB which at the moment is not very clear in the docs, for the "Origin request" I didn't get an error for this limit. :-(

ng-druid commented 1 year ago

Despite the disappointment that golang can't be used for edge lambdas happy to have stumbled on this thread. Did find it odd why this library wouldn't support Cloudfront events but everything else. This conversation clears it up nicely.

RedHoodedWraith commented 1 year ago

Glad to know I'm not the only one facing this issue

skryvets commented 10 months ago

Just stumbled upon this.

Considering that this issue has been open since 2018, is there any chance we can get an update on any progress or planned support for Lambda@Edge in Go?

Go's efficiency and low resource consumption could significantly benefit companies by reducing costs and increasing speed, which is critical for edge computing scenarios. Likewise, AWS could also see reduced resource usage on their end.

Really appreciate your help in advance

wannabewayno commented 4 months ago

Yearrrp, also stumbled across this looking for the right structs and then found out it's not supported :'( I'm surprised that Go and Rust runtimes aren't supported considering all Lambda@Edge functions run on Amazon Linux.

Throwing my appreciation behind this feature!

isaacdre commented 4 months ago

This is turning from a want to a need. Lambda@Edge is a race car with monster-truck wheels - yeah it gets the job done... but with a ton of unnecessary weight. Let us use the fast and nimble racing tires! Let us clock in blazing fast execution while reducing our carbon footprint! Let us GOOOOOOOOOOOO!

nicholasrobertm commented 1 month ago

Also have run into this. I'd prefer to be able to move our edge functions to go (especially viewer requests since they're hit by every page) rather than just having to increase limits to accommodate more requests / overhead with using node