awslabs / cognito-at-edge

Serverless authentication solution to protect your website or Amplify application
Apache License 2.0
168 stars 54 forks source link

Using cognito-at-edge as a layer on a lambda@edge function #70

Open gabrielcho opened 1 year ago

gabrielcho commented 1 year ago

How can we help?

I plan to use cognito-at-edge as a lambda layer in a lambda@edge function but when I try to bind it to my CloudFront triggers I get the following error:

The function cannot have a layer. Function: arn:aws:lambda:us-east-1:XXXXXXXXXXX:function:lambda-basic-auth:15

What am I missing? Is this supposed to run on a lambda@edge function?

jeandek commented 1 year ago

Hi @gabrielcho, This is supposed to run in a Lambda@Edge function. However, layers are not supported by Lambda@Edge (see docs).