Skip to content

Conversation

@bunchmj
Copy link
Member

@bunchmj bunchmj commented Nov 30, 2023

No description provided.

Comment on lines +108 to +113
dynamic_environment_variables = var.which_lambda_function == "password_rotation" ? {
users = join(",", var.users)
instance_ids = join(",", var.instance_ids)
} : var.which_lambda_function == "log_exportation" ? {
cloudwatch_logs_export_bucket = var.cloudwatch_logs_export_bucket
} : {}
Copy link
Member

Choose a reason for hiding this comment

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

I feel like this might get annoying to scale as we add more functions using this ternary pattern.
I'd recommend moving this to multiple locals (one local for password_rotation_environment_variables, one local for log_exportation_environment_variables) and then merging them all in under environment_variables or another local if you wanted

Copy link
Member Author

Choose a reason for hiding this comment

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

sounds better 👍

@zack-is-cool
Copy link
Member

zack-is-cool commented Dec 5, 2023

General question, is there a scenario where someone enables both log_exportation and password_rotation?
Does this module handle that scenario?

see thread below. I don't think we want that scenario anyway

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.

3 participants