https://pulumi.com logo
#python
Title
# python
f

fast-whale-9064

06/15/2020, 5:46 PM
Is there any documentation on using FileArchive? I’ve got a python lambda function with dependencies, and it looks like if you provide FileArchive a path it would include all files, but that doesn’t seem to be the case.
e

echoing-breakfast-73834

06/15/2020, 9:32 PM
IMO the documentation is lacking on
Archive
classes. I'm using
FileArchive(args.code_path)
to bundle everything in
args.code_path
(a folder) and it works for me
f

fast-whale-9064

06/15/2020, 9:40 PM
tbh I couldn’t find any documentation at all. I see it used in examples, but it isn’t described anywhere I could find.
I think I fixed my issue. after doing a
pip install -r requirements.txt -t ./packages
, I found I could do:
Copy code
code=pulumi.AssetArchive({
  '.': pulumi.FileArchive('script_folder/'),
  './': pulumi.FileArchive('script_folder/packages/')})
In addition to no documentation on Archive or Assets, I couldn’t figure out a way to have any visibility into the archive being produced.
e

echoing-breakfast-73834

06/16/2020, 3:26 PM
Yea I couldn't either, other than manually downloading (for debug purposes) the archive uploaded to the AWS lambda functions I uploaded it to There really should be more documentation here I think. I'd create a PR myself but I don't have a great grasp on those classes in the first place...
5 Views