-
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
Cannot parse value for variable for CIDR format #7971
Comments
Hi @tmtk75. Sorry for the problem here. It looks like in Terraform 0.7 the expected syntax here was changed to support passing maps and lists as variables, in addition to strings. I'm not 100% sure (I didn't hit this issue myself yet, since I tend to use environment variables to set Terraform variables) but I think you could get around this by making the
An alternative, that might be easier to read and less confusing, would be to create a separate variables file using HCL syntax and then use |
Hi @apparentlymart, thanks a lot to let me know the workaround! Regarding my use-case, I'd like to dynamically give my current IP address into I could fix my code like this and saw it worked as expected. Thank you so much!
variable cidr {}
resource "aws_security_group" "test" {
...
ingress {
cidr_blocks = [ "${var.cidr}" ] |
@tmtk75 you gave me an idea for interesting data source :) |
- Newest version of terraform changes how vars are parsed: hashicorp/terraform#7971
Closing since we got this figured out. |
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. |
After upgrading to v0.7.0, I can see next error.
I could not see the error with v0.6.16.
Affected Resource(s)
variable
, so it may be a terraform's core issue.Terraform Configuration Files
I can reproduce with this one.
Expected Behavior
It works as 0.6.16.
Actual Behavior
I got next error.
The text was updated successfully, but these errors were encountered: