aws-amplify / aws-amplify/amplify-hosting

Exclude assets/folder from Lambda@Edge on Cloudfront with Next.js Project

Open
#3,065 3 comments 0 reactions 0 assignees View on GitHub
feature-request ssr
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

**Please describe which feature you have a question about?**

We've noticed that there is a Lambda@Edge function attached to all the Cloudfront distributions created by Amplify. It seems that this Lambda@Edge handles e.g. basic auth on the static assets.

We have run into some issues due to exceeding execution limit quotas for the lambda due to it running on all the static assets included in the site. This Lambda must also surely be introducing a (small) performance penalty and it's not really necessary.

We'd like to be able to have certain directories of static assets in a Cloudfront distribution with no Lambda@Edge attached. Is this possible?

**Provide additional details**

NextJS version 12.2.0

**What AWS Services are you utilizing?**

- Amplify
- Cloudfront
- S3
- Lambda@Edge

Contributor guide

Open the contributing guide

Research direction

Review the Amplify Hosting CloudFront and Lambda@Edge configuration for the Next.js 12.2.0 setup, focusing on how static asset paths are handled. Reproduce the quota concern with the listed asset directories and determine the supported configuration boundary; done when selected paths bypass the edge function without breaking required behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, next.js
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.