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
Hi, @wsams! The thing is -1 is not an integer literal but an expression with a unary operator '-'. Every numeric expression will be transformed into a dollar-sign string.
Hi, @wsams! The thing is -1 is not an integer literal but an expression with a unary operator '-'. Every numeric expression will be transformed into a dollar-sign string.
Is this a limitation of HCL, or am I supposed to perform the interpolation myself on these dollar-sign variables? It probably wouldn't be hard to replace ${-1} with a literal -1 in the resulting JSON but it really seems like a bug in this library. I'm really confused why this isn't supported unless HCL doesn't support negative number types.
Hi, @wsams! The thing is -1 is not an integer literal but an expression with a unary operator '-'. Every numeric expression will be transformed into a dollar-sign string.
Activity
htorianik commentedon Jan 10, 2023
Hi, @wsams! The thing is -1 is not an integer literal but an expression with a unary operator '-'. Every numeric expression will be transformed into a dollar-sign string.
wsams commentedon Jan 10, 2023
Is this a limitation of HCL, or am I supposed to perform the interpolation myself on these dollar-sign variables? It probably wouldn't be hard to replace ${-1} with a literal -1 in the resulting JSON but it really seems like a bug in this library. I'm really confused why this isn't supported unless HCL doesn't support negative number types.
jerschne commentedon Jan 17, 2023
I really don't understand why -1 is not an integer? https://github.com/kvz/json2hcl and Terrraform interpreted it correctly as an integer.