terraform-aws-lambda-auto-package
terraform-aws-lambda-auto-package copied to clipboard
feat: Make archiving optional
Closes #29
Hey @nozaq
Thanks for the feedback.
I considered this initially... Setting a default implies they are optional parameters. If both output_path
and source_dir
are left with null
values, then the user could try to create a lambda without any deployment file. I wonder if it would succeed?
Looking at the official provider, the deployment-related variables are all optional (but logically at least one should be specified by the user).
Anyway, I've added S3 deployment as an alternative option. In retrospect, I guess that won't solve the issue either.
Eg If the S3 variables are also defaulted then the deployment could still try to create a lambda with no code.
Perhaps there is no way around it right now; at least, without adding complex validation rules supported in newer TF versions. I'm not sure if this would even be a good idea.
Anyway, let me know what you think.
I'll leave the S3 code here for your consideration.
@nozaq ready for review :)
@nozaq , bump :)