Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make archiving optional #30

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

baolsen
Copy link
Contributor

@baolsen baolsen commented Dec 9, 2022

Closes #29

@nozaq nozaq self-requested a review December 10, 2022 01:46
Copy link
Owner

@nozaq nozaq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baolsen Thanks for the suggestion!

To keep the backward compatibility, how about making both var.output_path and var.source_dir optional by setting default values? Currently both variables are required, so module users need to specify output_path argument even if they don't use it.

@baolsen
Copy link
Contributor Author

baolsen commented Dec 12, 2022

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
Copy link
Contributor Author

baolsen commented Dec 20, 2022

@nozaq ready for review :)

@baolsen
Copy link
Contributor Author

baolsen commented Jan 16, 2023

@nozaq , bump :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Make archiving optional
2 participants