Skip to content
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

reverse and back again not valid #10

Open
dynnamitt opened this issue May 2, 2018 · 1 comment
Open

reverse and back again not valid #10

dynnamitt opened this issue May 2, 2018 · 1 comment

Comments

@dynnamitt
Copy link

i cannot convert a tf to json and back again .. ( json2hcl -reverse < a.tf | json2hcl > b.tf )

a.tf ;

"terraform" = {
"backend" "local" {
"key" = "x.tfstate"
}
}

-- result b.tf

"terraform" = {
"backend" = {
"local" = {
"key" = "x.tfstate"
}
}
}

once back as b.tf iIT IS NOT valid syntax

Error loading ..../.../t2.tf: Error reading backend config for terraform block: position -: 'backend' must be followed by exactly one string: a type

@Acconut
Copy link
Collaborator

Acconut commented May 2, 2018

Similar errors have been reported many times (e.g. #4). The problem is that the official HCL parser library that we use, does not produce the same output as you input because there are multiple serialized version for a given HCL file. This comment contains two links with more details: #4 (comment)

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

No branches or pull requests

2 participants