tiivik
tiivik

Reputation: 91

Access files written into /tmp with aws sam local

I am working on a project using AWS SAM local. I am invoking a function with sam local invoke which successfully executes the function. The lambda function writes an image file into /tmp/image.png when the function is invoked. This writing operation happens in the environment of SAM local, the /tmp folder belongs to its docker environment.

Is there a way for me to access the files written into the /tmp folder while developing locally?

Upvotes: 6

Views: 3131

Answers (1)

Nop0x
Nop0x

Reputation: 173

This apparently has been answered on their github: Link

You create a /c/tmp directory and set the TMPDIR=/c/tmp environment variable while invoking.

echo '<!DOCTYPE html><html><head><title>HTML doc</title></head><body>Content<body></html>' | TMPDIR=/c/tmp  sam local invoke "HtmlToPdfFunction"

Upvotes: 1

Related Questions