terraform-aws-lambda-auto-package icon indicating copy to clipboard operation
terraform-aws-lambda-auto-package copied to clipboard

feat: Make archiving optional

Open baolsen opened this issue 2 years ago • 3 comments

Closes #29

baolsen avatar Dec 09 '22 06:12 baolsen

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.

baolsen avatar Dec 12 '22 06:12 baolsen

@nozaq ready for review :)

baolsen avatar Dec 20 '22 06:12 baolsen

@nozaq , bump :)

baolsen avatar Jan 16 '23 13:01 baolsen