Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Spurious error parsing existing Terraform configuration #11

Closed
apparentlymart opened this issue Feb 16, 2018 · 2 comments
Closed

Spurious error parsing existing Terraform configuration #11

apparentlymart opened this issue Feb 16, 2018 · 2 comments
Labels

Comments

@apparentlymart
Copy link
Contributor

apparentlymart commented Feb 16, 2018

When asked to parse a file from Terraform's public module registry, the HCL native syntax parser produced the following error:

Error: Missing newline after attribute definition at main.tf:104,3

An attribute definition must end with a newline.

This message seems to be a parsing bug, since line 104 is the following valid attribute definition:

  availability_zone       = "${element(var.azs, count.index)}"

It's referring to column 3 here, which is the location of the availability_zone identifier. Possibly there's some leftover state bleeding through from the previous line, causing the parser to get confused when it encounters the next token. Previous line is:

 cidr_block              = "${var.public_subnets[count.index]}"

(This also appears to be valid.)

@apparentlymart
Copy link
Contributor Author

Based on some local testing it seems like indeed the bug being triggered by the cidr_block line, since this error appears any time there's another attribute or block after it, regardless of what attribute or block it is.

@apparentlymart
Copy link
Contributor Author

This was fixed in 9dfc220.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant