# LambdaExecutionError from CloudFront

**URL:** <https://forum.serverless.com/t/lambdaexecutionerror-from-cloudfront/12303>\
**Category:** Serverless Framework\
**Tags:** lambda\
**Created:** [August 17, 2020, 9:49pm UTC](https://forum.serverless.com/t/lambdaexecutionerror-from-cloudfront/12303 "2020-08-17T21:49:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rp346](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@rp346](https://forum.serverless.com/u/rp346)\
**Post date:** [August 17, 2020, 9:49pm UTC](https://forum.serverless.com/t/lambdaexecutionerror-from-cloudfront/12303/1 "2020-08-17T21:49:44Z")

</div>

I am trying to deploy Lambda@Edge using following yaml

> **serverless.yml**
>
> ```
> > service: viewer-request
> > provider:
> > name: aws
> > runtime: nodejs12.x
> > region: ${opt:region, 'us-east-1'}
> > stage: ${opt:stage, 'staging'}
> > memorySize: 128
> > timeout: 10
> > 
> > functions:
> > viewerRequest:
> > handler: handler.viewerRequest
> > 
> > resources:
> > Resources:
> > IamRoleLambdaExecution:
> > Type: "AWS::IAM::Role"
> > Properties:
> > AssumeRolePolicyDocument:
> > Statement:
> > - Effect: Allow
> > Principal:
> > Service:
> > - lambda.amazonaws.com
> > - edgelambda.amazonaws.com
> > plugins:
> > - serverless-offline
> 
> ```

Then set trigger

Event type: viewer-request  
Include body: No  
Path pattern: /images/\*

But when I try to access web contents I get following error

```
2020-08-17	20:47:53	EWR52-C4	1274	72.79.124.96	GET	r1gcva4mhojctg.cloudfront.net	/images/email_icon.svg	503	https://stage.domain.com/	Mozilla/5.0%20(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_5)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/84.0.4147.125%20Safari/537.36	-	-	LambdaExecutionError	nkMyhXkEzWo6CMsOdS7qNS-fszUuQJ-FW6UDxYdKqxOuSoQmffKVwA==	stage.domain.com	https	48	1.472	-	TLSv1.2	ECDHE-RSA-AES128-GCM-SHA256	LambdaExecutionError	HTTP/2.0	-	-	52571	1.472	LambdaExecutionError	text/html	1019	-	-

```

Anyone know what I am missing here ?
