Skip to content

Planning fails when module is disabled #248

New issue

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

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

Already on GitHub? # to your account

Closed
bentmann opened this issue Oct 1, 2024 · 1 comment · Fixed by #254
Closed

Planning fails when module is disabled #248

bentmann opened this issue Oct 1, 2024 · 1 comment · Fixed by #254
Labels
bug 🐛 An issue with the system

Comments

@bentmann
Copy link

bentmann commented Oct 1, 2024

Describe the Bug

When the input variable enabled is set to false, terraform fails to plan.
The issue exists since https://github.com/cloudposse/terraform-aws-elasticache-redis/releases/tag/1.3.0 up until the current 1.7.0

The same issue was previously mentioned by #236 (comment) but the particular scenario apparently overlooked when a fix was implemented

Expected Behavior

When the module is disabled, terraform plan succeeds.

Steps to Reproduce

Try invoking terraform plan on a project using this module with its enabled argument set to false:

module "redis" {
  enabled = false
  source  = "cloudposse/elasticache-redis/aws"
  version = "1.6.0"
  ...
}

Screenshots

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Error in function call
│ 
│   on .terraform/modules/redis/main.tf line 113, in locals:
│  113:   endpoint_address = coalesce(local.endpoint_serverless, local.endpoint_cluster, local.endpoint_instance)
│     ├────────────────
│     │ while calling coalesce(vals...)
│     │ local.endpoint_cluster is null
│     │ local.endpoint_instance is null
│     │ local.endpoint_serverless is null
│ 
│ Call to function "coalesce" failed: no non-null, non-empty-string
│ arguments.
╵

Environment

  • Terraform 1.7.5
  • Module version 1.6.0

Additional Context

No response

@bentmann bentmann added the bug 🐛 An issue with the system label Oct 1, 2024
@ItgixSupport
Copy link

ItgixSupport commented Oct 14, 2024

For us it happens also when the variable is set to true.

To reproduce:

  • create with cluster mode enable - the first create works
  • Then try just plan without any changes - fails with the same error

Version 1.4.1

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants