Using Zeep[xmlsec] on a lambda

121 Views Asked by At

I'm have been trying to deploy a lambda function that need zeep[xmlsec] to work, But at this moment I couldn't install the xmlsec requirement to I am trying to deploy a lambda that queries a soap resource, which is why it has a dependency on the zeep[xmlsec] library. Until now it has been impossible to do so, because it generates the same error as on Mac. Has any of you deployed a lambda that uses said library that can guide me?

poor using virtual environments to install the libraries and create layers but it didn't work. A solution or help how I can do to display the lambda.

1

There are 1 best solutions below

0
Pablo Salazar On BEST ANSWER

I was able to deploy a lambda function with zeep==4.2.1 and lxml >= 3.8.0 using AWS SAM.

  1. First install aws cli and aws SAM CLI
  2. Crate a project with SAM CLI and select AWS Quick Start Templates enter image description here
  3. Select a template, for example I use the hello world template and then select the version of python, in my case I select the version 3.9
  4. Select Image instead of zip
    enter image description here
  5. add this to the requirements.txt file
requests
zeep==4.2.1
lxml >= 3.8.0
urllib3<2

and with sam build and sam deploy --guided you can deploy the lambda function.

Here is the link a the github code that I use