I’m trying to attached a lambda@edge managed by serverless framework to cloudfront distribution managed by terraform.
Terraform creates a cloudfront (xxx.cloudfront.net).
I have a lambda at edge function in serverless and I want to attach it to the existing xxx.cloudfront.netdistribution. The below example somehow creates a new distribution:
provider: name: aws runtime: nodejs10.x functions: lamboGeoLocationQa: handler: functions/handler.lamboQa events: - cloudFront: eventType: origin-request origin: https://xxx.cloudfront.net
Any ideas on how to do it? Might be a very simple solution, I’m just not that familiar with serverless.
Thanks a lot!