If you’re trying to troubleshoot issues with your code running in a Lambda@Edge function, you’ll discover that the logs are stored in the region the lambda was run in.

To find out which regions hold logs for your Lambda function, run this script (replacing YOUR_FUNCTION_NAME):

for region in $(aws --output text  ec2 describe-regions | cut -f 4)
do
    for loggroup in $(aws --output text  logs describe-log-groups --log-group-name-pattern "YOUR_FUNCTION_NAME" --region $region --query 'logGroups[].logGroupName')
    do
        echo $region $loggroup
    done
done