# Running the FDB client on AWS Lambda

**URL:** <https://forums.foundationdb.org/t/running-the-fdb-client-on-aws-lambda/1117>\
**Category:** Using FoundationDB\
**Created:** [February 6, 2019, 1:00am UTC](https://forums.foundationdb.org/t/running-the-fdb-client-on-aws-lambda/1117 "2019-02-06T01:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spullara](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/spullara/32/125_2.png) [@spullara](https://forums.foundationdb.org/u/spullara)\
**Post date:** [February 6, 2019, 1:00am UTC](https://forums.foundationdb.org/t/running-the-fdb-client-on-aws-lambda/1117/1 "2019-02-06T01:00:00Z")

</div>

I’m trying to get the FDB client (for Java) to work on AWS Lambda using their new Layers option. Right now I am putting fdb.cluster in the root and libfdb\_c.so in the lib directory. I think it is now finding the library but it is having trouble initializing the FDB class. Has anyone gotten this to work? What else might I need?

Update. Looking more closely it is first failing to load the library. Not sure why it isn’t finding it.

/tmp/fdbjni5638734001205186806.library: libfdb\_c.so: cannot open shared object file: No such file or directory: java.lang.UnsatisfiedLinkError  
java.lang.UnsatisfiedLinkError: /tmp/fdbjni5638734001205186806.library: libfdb\_c.so: cannot open shared object file: No such file or directory  
at java.lang.ClassLoader$NativeLibrary.load(Native Method)  
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)  
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)  
at java.lang.Runtime.load0(Runtime.java:809)  
at java.lang.System.load(System.java:1086)  
at com.apple.foundationdb.JNIUtil.loadLibrary(JNIUtil.java:106)  
at com.apple.foundationdb.FDB.\<clinit\>(FDB.java:97)  
at com.observeinc.Loader.handleRequest(Loader.java:179)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)

I’m constructing the layer as:

$ zip -u fdb\_layer.zip fdb.cluster lib/libfdb\_c.so  
zip warning: fdb\_layer.zip not found or empty  
adding: fdb.cluster (stored 0%)  
adding: lib/libfdb\_c.so (deflated 62%)

---

<div class="post-metadata">

**Author:** ![spullara](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/spullara/32/125_2.png) [@spullara](https://forums.foundationdb.org/u/spullara)\
**Post date:** [February 6, 2019, 1:31am UTC](https://forums.foundationdb.org/t/running-the-fdb-client-on-aws-lambda/1117/2 "2019-02-06T01:31:12Z")

</div>

Solved. Due to the way they lay out the layers you need to set LD\_LIBRARY\_PATH="/opt" and FDB\_CLUSTER\_FILE="/opt/fdb.cluster".
