-
Notifications
You must be signed in to change notification settings - Fork 359
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
Failed to initialize a runner when the count
is string
#1547
Comments
This seems to be a bug when evaluating the Fortunately, this bug seems to be fixed as a side effect of #1537. |
This looks like desirable behaviour to me, although the error message might need improving. Just because Terraform allows you to do something doesn't mean that it's necessarily a good idea. |
TFLint can complain something violates a certain rule, but it shouldn't crash. String vs number is such a low-level thing that maybe TFLint shouldn't also come up with its own requirements in this area. Yes, people should use a number but TF allows a string so be it... If TFLint considers that a critical failure, people will keep getting puzzled because the behavior is different from TF itself. |
TFLint's intent is to be able to parse anything that the supported Terraform version(s) can parse. You can certainly question whether support for this type conversion should have been cut in a past version of Terraform, either 0.12 or 1.0. The reason it's there is for backward compatibility. In 0.11, all attributes were provided as strings: count = "${var.resource_count}" We could certainly consider a We also can't always know the actual type, as in this example: count = data.terraform_remote_state.foo.outputs.resource_count Even if the output |
Also, minor point, but this wouldn't be considered a crash, just an unexpected error. TFLint is exiting with an error from the parser while initializing a runner. A |
Introduction
Terraform implicitly converts the
count
attribute to a number, so passing it as a string works fine:But this config doesn't work in TFLint v0.41.
Expected Behavior
It works fine without errors.
Actual behavior
Failed to initialize a runner; number value is required.
Step to Reproduce
Additional Context
The text was updated successfully, but these errors were encountered: