-
Notifications
You must be signed in to change notification settings - Fork 113
Lambda could not load resource bundle #501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for having reported this. This issue is fixed in the main branch and there is an example project you can use as a reference. |
Thanks for the quick response. We are using this in conjunction with: https://github.com/hummingbird-project/hummingbird-lambda It looks like their v2 development branch has fallen behind |
I will ask @adam-fowler to check - thanks for having reported this. |
The issue being reported is unrelated to the version of Hummingbird. Although I should release a new beta, with 1.0.0 of swift-aws-lambda-events. This is probably related to the archive plugin not packaging the resources. |
There is the start of an implementation of hummingbird-lambda with the new v2 runtime in the |
Thank you @adam-fowler I have been looking at |
@adam-fowler @johnmorrell |
@sebsto @adam-fowler thanks for all the work on theses projects, I'll look out for the new releases. |
@johnmorrell I've updated the |
@johnmorrell if the Lambda packager plugin continues to fail including resources in the zip, please let us know. |
Thank you. Are you able to include the equivalent of:
|
You could add your own wrapper for that @main
struct MyApp {
static func run() async throws {
let router = Router()
...etc
}
} |
I was able to get up and running with APIGW v2 using the two projects, however I still hit the original issue. Using the same hello.txt package reference as the example project above I am able to access the file running the server locally and calling with a JSON body via
The CloudWatch error on trying to access the resource is:
So *.resources is not deployed. The closest to getting something working is to manually add the
Which did allow we to access the file via APIGW/Lambda. |
Thank you @johnmorrell for the extra checks.
|
I don't access the resource file with You can see the code example here.
I just build and deployed the ZIP file, and it returned the content of the file.
|
Thanks @sebsto I can confirm package file contains the resource reference as your example. It would not compile or work locally without it when using the I have just tried running the |
I'm glad we identified the issue. To summarize the above discussion : it looks like the resources are not bundled when running the |
That's right. I have just added a step to add the static resource |
Yes, this is just a workaround. I'll try to fix the root cause. |
Thank you for having reported this problem. I can reproduce the issue with |
I have a swift target including static resources referenced in the package target. This target is included in the Lambda executable. The static resources are available when running locally via a CLI executable. When deployed to Lambda via the archive plugin using
1.0.0-alpha.3
these resources don't seem to be available. The error from CloudWatch is:The text was updated successfully, but these errors were encountered: