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

True and False portions of conditionals always evaluated #18340

Closed
rrati opened this issue Jun 27, 2018 · 2 comments
Closed

True and False portions of conditionals always evaluated #18340

rrati opened this issue Jun 27, 2018 · 2 comments

Comments

@rrati
Copy link

rrati commented Jun 27, 2018

Terraform Version

Terraform v0.11.5

...

Terraform Configuration Files

locals {
version_split = "${split(",", var.os_version)}"
minor = "${length(local.version_split) >= 2 ? "${local.version_split[1]}" : "0"}"
}

variable os_version{
type = "string"
default = ""
}

...

Debug Output

https://gist.github.com/rrati/95ba6a157158a157b16982dca20cec9e

Crash Output

Expected Behavior

Should have evaluated the conditional portion and then only evaluated either the true or false portion based upon the result.

Actual Behavior

Both true and false portions of the conditional are evaluated all the time.

Steps to Reproduce

  1. Copy provided config to a .tf file
  2. Run terraform apply

Additional Context

References

@mildwonkey
Copy link
Contributor

Hi @rrati -
I'm sorry you've come across this bug. It is a known issue, #15605
I'm going to close this ticket so we can consolidate the conversation in #15605

Thank you for your report!

@ghost
Copy link

ghost commented Apr 3, 2020

I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants