You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
variable"role" {
description="Overwrite the role variable "default="plat"
}
variable"elb_role" {
type="map"description="Role name of ELB if provisioning multiple ELBs"default={
plat =2
}
}
Expected Behavior
Should have printed "yes"
Actual Behavior
Got a type error
Steps to Reproduce
$ terraform console
> lookup(var.elb_count, var.role)
2
> lookup(var.elb_count, var.role) > 1 ? "yes" : "no"
At column 3, line 1: <, >, <= and >= may apply only to int and float values in:
${lookup(var.elb_count, var.role) > 1 ? "yes" : "no"}
> var.elb_count[var.role] > 1 ? "yes" : "no"
At column 3, line 1: <, >, <= and >= may apply only to int and float values in:
${var.elb_count[var.role] > 1 ? "yes" : "no"}
> (var.elb_count[var.role] + 0) > 1 ? "yes" : "no"
yes
>
The text was updated successfully, but these errors were encountered:
Thanks for filing this, @onlyanegg! We discussed this a bit in Glitter chat.
The last line of the reproduction steps above is the workaround I would suggest for anyone running into this issue before it gets fixed.
I believe the issue here is that the comparison operators are not correctly promoting string operands to a numeric type as we'd do for arithmetic operators. This is the same class of problem as hashicorp/hil#43, so I may just fix them both together since it'll be touching similar areas of the code anyway.
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
locked and limited conversation to collaborators
Apr 18, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform v0.8.1
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Should have printed "yes"
Actual Behavior
Got a type error
Steps to Reproduce
The text was updated successfully, but these errors were encountered: