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

null value not working with && operator #27571

Closed
Raghav2211 opened this issue Jan 22, 2021 · 2 comments
Closed

null value not working with && operator #27571

Raghav2211 opened this issue Jan 22, 2021 · 2 comments
Labels
bug new new issue not yet triaged

Comments

@Raghav2211
Copy link

Raghav2211 commented Jan 22, 2021

Terraform Version

Terraform v0.13.5

Terraform Configuration Files

main.tf:

module test {
  source         = "./module1"
}

module1/main.tf:

variable test_null {
   type    = number
   default = null
}

locals {
   test_null  = var.test_null != null && var.test_null > 0 ? var.test_null : 1
}

Actual Behaviour

test_null = var.test_null != null && var.test_null > 0 ? var.test_null : 1
|----------------
| var.test_null is null

Error during operation: argument must not be null.

Expected Behaviour

local.test_null should be successfully evaluated as 1

@Raghav2211 Raghav2211 added bug new new issue not yet triaged labels Jan 22, 2021
@jbardin
Copy link
Member

jbardin commented Jan 22, 2021

Thanks @Raghav2211, marking as a duplicate of #24128

@jbardin jbardin closed this as completed Jan 22, 2021
Raghav2211 pushed a commit to Raghav2211/todo-app-infra that referenced this issue Jan 22, 2021
@ghost
Copy link

ghost commented Feb 22, 2021

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 as resolved and limited conversation to collaborators Feb 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants