# AWS Confluent based layer for Lambda usage

**URL:** <https://forum.confluent.io/t/aws-confluent-based-layer-for-lambda-usage/8174>\
**Category:** Non-Java Clients\
**Created:** [26 June 2023 14:30 UTC](https://forum.confluent.io/t/aws-confluent-based-layer-for-lambda-usage/8174 "2023-06-26T14:30:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [26 June 2023 14:30 UTC](https://forum.confluent.io/t/aws-confluent-based-layer-for-lambda-usage/8174/1 "2023-06-26T14:30:17Z")

</div>

hi hi  
Does anyone have a zip file for a python: confluent client / import that they know works…  
Python 3.9  
I’ve followed multiple examples and keep ending with the same result:  
“errorMessage”: “Unable to import module ‘lambda\_function’: No module named ‘confluent\_kafka.cimpl’”,  
or  
“errorMessage”: “Unable to import module ‘lambda\_function’: No module named ‘confluent\_kafka’”,  
CONFLUENT: would really be great if this was available as a useable ARN based layer.  
G

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [28 June 2023 11:42 UTC](https://forum.confluent.io/t/aws-confluent-based-layer-for-lambda-usage/8174/2 "2023-06-28T11:42:11Z")

</div>

Hi guys…

Got the python import eventually to work…

Resolution was to build a EC2 instance, install python 3.9.16, create virtual env, install libraries =2.1.1 , zip libraries… upload as a layer.

Initially used a EC2 instance I had, build on Ubuntu, did not work, had to spin a new EC2 using amazon Linux (as that is what Lambda’s use). Worked.

Now to dig a hole through our firewalls to get outside onto the cluster.

If anyone needs these libraries, happy to share.  
G

---

<div class="post-metadata">

**Author:** ![aajay](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@aajay](https://forum.confluent.io/u/aajay)\
**Post date:** [11 July 2024 03:37 UTC](https://forum.confluent.io/t/aws-confluent-based-layer-for-lambda-usage/8174/3 "2024-07-11T03:37:20Z")

</div>

Hi georgelza,

I’m also received the same error while executing the AWS lambda function. It will be help full if u share the libraries. Can you please share the libraries to this mail id [aajayksk12@gmail.com](mailto:aajayksk12@gmail.com)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![suryadeepan](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@suryadeepan](https://forum.confluent.io/u/suryadeepan)\
**Post date:** [3 August 2024 17:47 UTC](https://forum.confluent.io/t/aws-confluent-based-layer-for-lambda-usage/8174/4 "2024-08-03T17:47:31Z")

</div>

I am also trying to import confluent\_kafka and followed the steps below:

```auto
python3.9 -m venv aws_layer_creation
source aws_layer_creation/bin/activate
mkdir -p streamer_lib/python/lib/python3.9/site-packages
pip install confluent_kafka -t streamer_lib/python/lib/python3.9/site-packages/
deactivate
sudo rm -rf aws_layer_creation
cd streamer_lib/
zip -r9 ../streamer_lib.zip python

```

Created Layer using the above created zip file.  
Getting the below error:

```auto
Unable to import module 'lambda_function': /lib64/libpthread.so.0: version `GLIBC_2.28' not found (required by /opt/python/lib/python3.9/site-packages/confluent_kafka/../confluent_kafka.libs/librdkafka-36eea7b5.so.1)

```

Can you please share the zip file with me?  
[suryadeepanlm@gmail.com](mailto:suryadeepanlm@gmail.com)

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [7 August 2024 05:59 UTC](https://forum.confluent.io/t/aws-confluent-based-layer-for-lambda-usage/8174/5 "2024-08-07T05:59:44Z")

</div>

did you come right, got all this working my side in the end, for Python.  
G

---

<div class="post-metadata">

**Author:** ![ssangam](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@ssangam](https://forum.confluent.io/u/ssangam)\
**Post date:** [11 September 2024 23:53 UTC](https://forum.confluent.io/t/aws-confluent-based-layer-for-lambda-usage/8174/6 "2024-09-11T23:53:01Z")

</div>

Hi Georgelza,

I received the following error  
Error: Lambda function (create-pretrade-topics-lambda) returned error: ({“errorMessage”: “Unable to import module ‘pretrade-topics-lambda’: /lib64/libpthread.so.0: version `GLIBC\_2.28’ not found (required by /opt/python/confluent\_kafka/…/confluent\_kafka.libs/librdkafka-bc407dcd.so.1)”, “errorType”: “Runtime.ImportModuleError”, “requestId”: “”, “stackTrace”: })

Can you please share the libraries to my email [sangam.sridhar@gmail.com](mailto:sangam.sridhar@gmail.com)  
Thanks
