Skip to content

Instantly share code, notes, and snippets.

@jwerre
Last active May 27, 2021 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwerre/10c52fb551ea178a66134b073f13ffdc to your computer and use it in GitHub Desktop.
Save jwerre/10c52fb551ea178a66134b073f13ffdc to your computer and use it in GitHub Desktop.
Lambda@Edge Origin Request Event Handler - deployment configuration
---
service: my-lambda-edge
provider:
name: aws
region: us-east-1 # Lambda@Edge need to be in us-east-1
stage: ${opt:stage, 'production'}
runtime: nodejs14.x
stackName: ${self:service}-${self:provider.stage}
logRetentionInDays: 90 # this does not work but hopefuly it will someday🤞🏻
memorySize: 128 # max memory size for viewer events is 128 MB
timeout: 5 # max timeout for viewer events is 5
role: arn:aws:iam::<ACCOUNT_ID>:role/service-role/<ROLE_NAME>
package:
exclude:
- ./**
include:
- functions/*.js
functions:
originRequest:
handler: functions/origin_request.handler
events:
- preExistingCloudFront:
distributionId: <CLOUDFRONT_DISTRIBUTION_ID>
eventType: origin-request
pathPattern: '*'
includeBody: false
plugins:
- serverless-lambda-edge-pre-existing-cloudfront
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment