Reputation: 71
I created a new lambda function but do not see cloudfront as an option in the Triggers. Does anybody know why that might be? Thanks
Upvotes: 6
Views: 2629
Reputation: 1988
As per AWS current documentation:
Make sure that you’re in the US-East-1 (N. Virginia) Region. You must be in this Region to create Lambda@Edge functions.
See: AWS Tutorial: Creating a Simple Lambda@Edge Function
Upvotes: 8
Reputation: 179094
CloudFront's Lambda@Edge integration feature requires that the functions be written in Node.js. It isn't possible to trigger a function in another language directly from CloudFront.
You must create functions with the
nodejs6.10
ornodejs8.10
runtime property.
Of course, in the Node.js runtime environment, you have the AWS Javascript SDK available, so if you had a really compelling case, you could use that from a Javascript function to invoke another, different Lambda function written in a different language... but it's difficult to imagine a common case where that would make sense, because of the added latency and cost, but I have, for example, used this solution to allow Lambda@Edge to reach inside a VPC -- which can only be done by invoking a second Lambda function (which could be configured to have VPC access) from inside the first (which can't, because Lambda@Edge functions run in the region nearest to the viewer, rather than in a single region, so they will not run inside a VPC).
Upvotes: 0
Reputation: 501
You cannot add from Lambda console. For adding trigger for cache behavior, you need to do it from CloudFront console.
Its is explained in detail here - https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-edge-add-triggers-cf-console.html
Upvotes: 0