You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Building HCL from scratch" example results in invalid terraform file #301
This result doesn't feel right - I'd expect the terraform to look like this:
resource"aws_instance""web" {
ami="abc-123"instance_type="t2.micro"tags={
Name ="HelloWorld"
}
}
i.e. the strings get quoted where needed and tags is not a block.
Ideally, the example would, however, include both strings and identifiers. This would be of huge help in understanding how to use this library. To expand the existing example, the ami could be the thing that uses an identifier referencing a data source (I don't think it's crucial to include the data source itself in the example):
resource"aws_instance""web" {
ami=data.aws_ami.ubuntu.idinstance_type="t2.micro"tags={
Name ="HelloWorld"
}
}
Specifically, as a user, I have no clue how to tell this library to safely quote a string - wrapping the string in " without some additional work to ensure everything is properly escaped. Perhaps it's worth showing an example of HCL interpolation as well? I do think it would be helpful to both show how to get anything that may get treated as interpolation inside a string escaped and how not to get it escaped. I'm not sure that the library currently has any APIs that actually allow for this, though.
Activity