claranet / terraform-aws-lambda

Terraform module for AWS Lambda functions
MIT License
157 stars 127 forks source link

Zip file is created every time #64

Closed fdmsantos closed 6 months ago

fdmsantos commented 4 years ago

First of all, Congratulations for this module. I love it.

I have noticed the zip file is created every time when terraform apply runs ( With or Without source code changes) This doesn't have an impact, because the trigger to replace the lambda is the filename. In your built.py script, you have a code to update the time if the file doesn't change. But when you check if the path exists, the path is the relative path from the directory where I ran the terraform apply command, so the path don't exist and will build the file again, with the same name. If we put the module_realpath, the problem is solved.