Where are the AWS CloudFront Lambda@Edge logs and metrics?
Feb 2022 - this post is permanently moved to https://architectfwd.com, my new site, and can be found here - https://architectfwd.com/architecture/cloud/amazon-web-services-aws/dns-domains-route-53/2022/01/23/aws-cloudfront-lambda-at-edge-cloudwatch-logs/ please go and bookmark that site for all of my future content.
Lambda@Edge
I'd created a lambda@edge function bound to a CloudFront distribution and to a specific origin event. In my instance it was to modify the default root object in a request URI for a static site hosted in AWS S3 which is fronted by CloudFront.
You've looked at the metrics in Lambda after CloudFront status for the distribution is Deployed
You've looked at the metrics in Lambda after CloudFront status for the distribution is Deployed
It looks like the function is not being triggered, why is that. Well, go over to CloudFront, look at the metrics tab and select the Lambda@Edge function, and you will see the region where the function is being triggered from, which you wouldn't be able to see by changing regions on the console.
Here's an example:
Take a look at which regions through hovering overHere's an example:
It looks I'm hitting Sydney, so the best place to go is the CloudWatch logs in Sydney. Take a look in the console by changing regions to Sydney, look at the Log Groups and there are my logs. The same metrics as seen in the CloudFront metrics is available in the CloudWatch metrics.
Cheers
QuintesQuintes van Aswegen Togaf 9 Certified Architect, Professional Scrum Master I (PSM I) Certified