1

I'm trying to perform HTML to PDF conversion with class library in AWS lambda function. The HTML converter has some dependency packages to be installed in the environment where the conversion takes place.

So, I tried to install the packages using shell script in AWS Lambda environment. But I am getting errors when trying to install the packages. Below is the commands, which I have used in shell script file.

yum update && yum install -y xvfb && yum install -y fontconfig && yum install -y libssl1.0-dev && yum install-y libx11-dev libx11-xcb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-shm0-dev libxcb-util0-dev libxcb-xfixes0-dev libxcb-xkb-dev libxcb1-dev libxfixes-dev libxrandr-dev libxrender-dev 

Below is the error message which i am getting from AWS lambda function,

START RequestId: 97f21900-ba81-4923-839e-749c9eadcfef Version: $LATEST Loaded plugins: priorities Could not set cachedir: https://forums.aws.amazon.com/ Read-only file system: '/var/tmp/yum-sbx_user1051-x3cqvF' You need to be root to perform this command. PdfException REPORT RequestId: 97f21900-ba81-4923-839e-749c9eadcfef Duration: 1425.16 ms Billed Duration: 1500 ms Memory Size: 512 MB Max Memory Used: 109 MB Init Duration: 199.94 ms XRAY TraceId: 1-5d7631af-bfd9a0cc7f15107f487d8f2e SegmentId: 40a286234dd2b759 Sampled: false

I am trying to run the shell script file using C# from the AWS lambda function. I need to install the above mentioned packages in AWS lambda function environment.

Prakash
  • 11
  • 2
  • I never did that, but I know that you can create lambda layers so before your deploy your lambda you will deploy a layer with all your dependencies and your lambda will be deployed above this layer – Krismorte Apr 23 '20 at 13:19

0 Answers0