-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
strconv.ParseInt: parsing invalid syntax error for simple var #4738
Comments
Hi @jemmyw! I feel you're likely running into the issue of not currently being able to store lists in variables - this is a feature on our roadmap. In the absence of this, you'd need to do something like this:
If it is generated by another resource or the output from a module, you can construct such a list by using the I'll go ahead and close this issue for now as the underlying problem is tracked in #57. If you have further questions on this please feel free to reopen it! |
Hi @jen20, I can't really see how the stage names is related to the |
@jen20 just to make sure, I did change my var.stage_names to be a comma delimited string, and the same error still occurs:
And note that I still only get that error on my control machine running on EC2, it doesn't occur on my local machine, and if I change it from |
@jen20 I can tell you what is special about those 2 resources. An output attribute of those 2 is passed in to a module. |
Rather than a problem with your config syntax, I'd check that the var isn't somehow getting set to a value which can't be parsed to an int. I'm just not sure how. See, I ran into a similar problem today where I had a reference like ...
... with a default setup like ...
... and a .tfvars file like ...
This constantly failed with the same error as yours. However, when I populated the defaults like ...
... the problem went away. I suspect some funny treatment of zero values here. So, the causes here might not be the same but I'd suggest that the value of your variable is potentially an issue. Or even the default value. HTH at least. |
+1 |
This is fixed or is covered by #3888 |
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. |
I have a variable defined as:
So it is simple and not calculated or over-ridden. I'm using it for the count in a number of places. When I run terraform plan on my local computer it works fine. When I run it on my control machine I get the following error:
This is odd for 2 reasons. First of all I'm using the same variable in other places in the same file just fine. If i replace the variable with a value it works ok. And secondly it runs fine on my local machine, and I'm using the same docker container in both places to run terraform.
I'm at my wits end with it really, I can't figure out what I should do to debug it.
Here is a non-working resource:
and here is a working one in the same file!
The text was updated successfully, but these errors were encountered: