cmur2 / language-terraform

Terraform.io support for Atom
MIT License
49 stars 32 forks source link

using $file causes syntax highlighting issues #13

Closed zapman449 closed 8 years ago

zapman449 commented 8 years ago

The third line in this stanza does not get highlighted correctly:

resource "aws_key_pair" "deployer" { key_name = "deployer-key" public_key = "$file("sshkeys/production${var.aws_region}.pem.pub")" }

It seems to not process the quotes properly when nested inside other parens or curly braces.

tranberg commented 8 years ago

According to the documentation you should use curly braces:

Built-in Functions Terraform ships with built-in functions. Functions are called with the syntax name(arg, arg2, ...). For example, to read a file: ${file("path.txt")}. The built-in functions are documented below.

This will get highlighted properly:

resource "aws_key_pair" "deployer" { key_name = "deployer-key" public_key = "${file("sshkeys/production${var.aws_region}.pem.pub")}" }

zapman449 commented 8 years ago

Thank you