sparse-intern-71089
11/16/2022, 10:29 AMbrave-planet-10645
11/16/2022, 10:32 AM/tmp
because that’s the only writable location, plus it’s not available until after the lambda container has started so you’ll need to copy the pulumi binaries there (and make sure the correct env vars are pointing there too)brave-planet-10645
11/16/2022, 10:33 AMthousands-engineer-52020
11/16/2022, 10:34 AM${LAMBDA_TASK_ROOT}
specified on Dockerfile, which is the official AWS dockerfilethousands-engineer-52020
11/16/2022, 10:34 AMFROM public.ecr.aws/lambda/python:3.8
# Install the function's dependencies using file requirements.txt
# from your project folder.
RUN yum install -y tar gzip && \
yum clean all
COPY requirements.txt pulumi-v3.44.2-linux-x64.tar ./
RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"
RUN tar -xvf ./pulumi-v3.44.2-linux-x64.tar --strip-components=1 -C /usr/local/bin
# Copy function code
COPY lambda_function.py ${LAMBDA_TASK_ROOT}
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
CMD [ "lambda_function.lambda_handler" ]
brave-planet-10645
11/16/2022, 10:36 AM${LAMBDA_TASK_ROOT}
but you’ll still need the Pulumi CLI in therethousands-engineer-52020
11/16/2022, 10:40 AMbrave-planet-10645
11/16/2022, 10:40 AM$PULUMI_HOME
needs to be there as well (as we explicitly write to that folder)thousands-engineer-52020
11/16/2022, 2:52 PMPULUMI_HOME
to /tmp
, but still aws lambda failed without explicit error (I've check and pulumi files are well created in /tmp). Is there a way to activate debug mode (like logger.setLevel(logging.DEBUG)
)