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

fix: add default values to allow for completely disabling module with bare minimum input #342

Merged

Conversation

bryantbiggs
Copy link
Member

Description

  • add default values to allow for completely disabling module with bare minimum input

Motivation and Context

  • this allows users to completely disable any resource creation by setting the bare minimum amount of inputs and without running into issues (i.e. - coalesce() on empty values)

Closes #335
Closes #341

Breaking Changes

  • No

How Has This Been Tested?

  • I have tested and validated these changes using one or more of the provided examples/* projects
    • validated with complete-postgresql

@antonbabenko antonbabenko merged commit 19e7902 into terraform-aws-modules:master May 26, 2021
@antonbabenko
Copy link
Member

Thanks, Bryant!

v3.1.0 has been just released.

@@ -1,6 +1,6 @@
locals {
master_password = var.create_db_instance && var.create_random_password ? random_password.master_password[0].result : var.password
db_subnet_group_name = var.replicate_source_db != null ? null : coalesce(var.db_subnet_group_name, module.db_subnet_group.db_subnet_group_id)
db_subnet_group_name = var.replicate_source_db != null ? null : coalesce(var.db_subnet_group_name, module.db_subnet_group.db_subnet_group_id, var.identifier)
Copy link
Member

Choose a reason for hiding this comment

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

Btw, we have some similar workaround for coalesce() in other modules where it was not possible to import resources. Eg: https://github.com/terraform-aws-modules/terraform-aws-lambda/blob/master/iam.tf#L14

@bryantbiggs bryantbiggs deleted the fix/coalesce-group-name branch May 26, 2021 12:29
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Call to function "coalesce" failed: no non-null, non-empty-string arguments.
2 participants