# Swift 5.3 Resources for Lambda (Linux)

**URL:** <https://forums.swift.org/t/swift-5-3-resources-for-lambda-linux/42359>\
**Category:** Using Swift\
**Tags:** linux, lambda\
**Created:** [November 30, 2020, 4:28pm UTC](https://forums.swift.org/t/swift-5-3-resources-for-lambda-linux/42359 "2020-11-30T16:28:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcta0717](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@lcta0717](https://forums.swift.org/u/lcta0717)\
**Post date:** [November 30, 2020, 4:28pm UTC](https://forums.swift.org/t/swift-5-3-resources-for-lambda-linux/42359/1 "2020-11-30T16:28:44Z")

</div>

I have a package that I'm intending to deploy on an AWS lambda (following [this tutorial](https://fabianfett.de/getting-started-with-swift-aws-lambda-runtime)). The package has 2 targets - the library is one target, and the lambda is another target (the executable). The lambda target basically just has 1 file (main.swift) and imports the library.

When generating the code and running a standard executable (not for a lambda), all of the normal commands pass (build, run, and test). All of my resources are compiled and work correctly.

However, when I build and deploy on the lambda function I created, I get the following error:

```swift
Fatal error: could not load resource bundle:
from /var/task/<package>_<target>.resources
or /src/.build/x86_64-unknown-linux-gnu/release/<package>_<target>.resources:
file <target>/resource_bundle_accessor.swift, line 11

```

I do see that it is similar to [this topic](https://forums.swift.org/t/swift-5-3-spm-resources-in-tests-uses-wrong-bundle-path/37051), but when running `swift test` it works just fine.

I can post my Package.swift file, package structure, just not sure what's relevant.

---

<div class="post-metadata">

**Author:** ![lcta0717](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@lcta0717](https://forums.swift.org/u/lcta0717)\
**Post date:** [November 30, 2020, 8:00pm UTC](https://forums.swift.org/t/swift-5-3-resources-for-lambda-linux/42359/2 "2020-11-30T20:00:46Z")

</div>

I figured out that it was a problem with the shell script (package.sh). It wasn't copying over the resources into the lambda.zip it was creating

---

<div class="post-metadata">

**Author:** ![eneko](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/eneko/32/12117_2.png) [@eneko](https://forums.swift.org/u/eneko)\
**Post date:** [January 6, 2021, 6:13pm UTC](https://forums.swift.org/t/swift-5-3-resources-for-lambda-linux/42359/4 "2021-01-06T18:13:23Z")

</div>

Out of curiosity, how are you using these resources? what kind of resources?

---

<div class="post-metadata">

**Author:** ![blday201](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@blday201](https://forums.swift.org/u/blday201)\
**Post date:** [February 21, 2024, 6:21pm UTC](https://forums.swift.org/t/swift-5-3-resources-for-lambda-linux/42359/5 "2024-02-21T18:21:28Z")

</div>

I think I have this same issue. It seems like my resources are included properly, but I keep getting the same error message no matter what I try. What exactly did you change in the package.sh script?
