Access files written into /tmp with aws sam local
Asked Answered
G

1

6

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?

Gegenschein answered 9/10, 2019 at 6:55 Comment(0)
W
1

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"
Weir answered 29/10, 2019 at 10:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.