aws-samples / cloudfront-authorization-at-edge

Protect downloads of your content hosted on CloudFront with Cognito authentication using cookies and Lambda@Edge
https://aws.amazon.com/blogs/networking-and-content-delivery/authorizationedge-using-cookies-protect-your-amazon-cloudfront-content-from-being-downloaded-by-unauthenticated-users/
MIT No Attribution
461 stars 157 forks source link

Use webpack also to bundle the custom resource code #263

Closed ottokruse closed 3 months ago

ottokruse commented 3 months ago

Issue #, if available: N/A

Description of changes: Use webpack also to bundle the custom resource code. This is necessary because we upgraded to Node v20 in #262 which aws-sdk was added as an explicitly included dependency for the custom resources (the Node v20 runtime does not ship it out of the box like v16 would). Unfortunately that blew up the total package size beyond 50 MB, which prevents publishing to SAR. This PR fixes that.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.