Lambda SPM ResourcesPosted Tuesday, February 6, 2024.
There is an additional step you need to do when packaging an SPM based Lambda that has resources.
Imagine we had a handler that would look for a resource decided by the request parameters:
Without doing any extra steps,
Bundle.module.url(forResource:withExtension:) would return nil when running on the Lambda because the resources are not bundled properly (even if the resource was "supposed" to exist).
Steps to Mitigate
Upload new Lambda zip to AWS