Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Argument names must not be quoted #476

Open
heydonovan opened this issue Jun 28, 2019 · 5 comments
Open

Argument names must not be quoted #476

heydonovan opened this issue Jun 28, 2019 · 5 comments

Comments

@heydonovan
Copy link

heydonovan commented Jun 28, 2019

Just needed to grab a security group from our production account:

resource "aws_security_group" "whitelist" {

   ...removed for brevity...

    tags {
        "apps" = "redacted"
        "Name" = "redacted
        "Notes" = "redacted"
    }
}

It looks like terraform fmt complains about the following:

$ terraform version
Terraform v0.12.3

$ terraform fmt

Error: Invalid argument name

  on security_group.tf line 38:
  (source code not available)

Argument names must not be quoted.
@jmpsf
Copy link

jmpsf commented Sep 9, 2019

I had the same problem, the correct tf snippet that worked for me was:

resource "aws_security_group" "whitelist" {

   ...removed for brevity...

    tags = {
        apps = "redacted"
        Name = "redacted
        Notes = "redacted"
    }
}

@xlr-8
Copy link

xlr-8 commented Sep 12, 2019

Actually I think that tags with special characters (. : etc), you need quotes, see the terraform issue. Could you test it please?

@earchibald-lv
Copy link

Tags with special characters may need to be quoted, but "normal" tags which are quoted fail the HCL parser:

Error: Invalid argument name

  on main.tf line 79, in resource "aws_vpc" "SpeechIQ-Prod":
  79:         "Name" = "SpeechIQ-Prod"

Argument names must not be quoted.

@on3iropolos
Copy link

on3iropolos commented Mar 24, 2020

For clarity, tags need to have the quotes removed after pulling the tf.

@on3iropolos
Copy link

Duplicate of #487

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

No branches or pull requests

5 participants