https://pulumi.com logo
Title
t

thousands-psychiatrist-72487

08/13/2021, 6:36 PM
I'm trying to run pulumi automation API in AWS lambda but I'm running into
mkdir /home/sbx_user1051: read-only file system
. That makes sense, since only
/tmp
is writable in Lambda, but I'm struggling to find the right setting to configure the write location for automation API. Has anyone run into this?
m

millions-furniture-75402

08/13/2021, 7:01 PM
I just ran into something similar with a lambda-layer and openssl. My solution was to set then environment variable HOME=/tmp
t

thousands-psychiatrist-72487

08/13/2021, 7:06 PM
Interesting. I see the idea behind it, by setting your home dir to somewhere writable you'd get around that issue. I just tried it with the same error result though
I'm sure it's in the docs somewhere but I found the fix by digging into venv/lib/pulumi for python. Setting
PULUMI_HOME
to "/tmp" works
👍 1
b

brave-planet-10645

08/14/2021, 8:48 AM
I was looking at this a few months ago. /tmp is only accessible once the lambda has started (i.e. you can't out things there during the docker build step) I had code in my lambda that would copy things from a location in the container to tmp and then point the PULUMI_HOME env car to that and continue from there
t

thousands-psychiatrist-72487

08/16/2021, 3:25 PM
Interesting; fortunately I didn't have to do anything like that. Just setting that env var and including a pulumi binary in /layer/bin was good enough to get the job done