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

Planning fails when module is disabled #248

Open
bentmann opened this issue Oct 1, 2024 · 1 comment
Open

Planning fails when module is disabled #248

bentmann opened this issue Oct 1, 2024 · 1 comment
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

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

No branches or pull requests

2 participants