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

Argument names must not be quoted, but throws an error when unquoted #22095

Closed
pgporada opened this issue Jul 16, 2019 · 3 comments
Closed

Argument names must not be quoted, but throws an error when unquoted #22095

pgporada opened this issue Jul 16, 2019 · 3 comments

Comments

@pgporada
Copy link

pgporada commented Jul 16, 2019

Terraform Version

$ terraform version
Terraform v0.12.4

Expected Behavior

I should be able to use the fixed tag ignoring functionality introduced by #21788 and this comment #21444 (comment)

Actual Behavior

resource "aws_vpc" "ct" {
  cidr_block                       = "${var.vpc_cidr_ipv4}"
  assign_generated_ipv6_cidr_block = "true"
  instance_tenancy                 = "default"
  enable_dns_support               = true
  enable_dns_hostnames             = true

  tags {
    Name       = "${var.infra_name}_${replace(var.region,"-","")}"
    TERRAFORM  = "true"
    INFRA_NAME = "${var.infra_name}"
    "kubernetes.io" = "unset"
  }

  lifecycle {
    create_before_destroy = true
    ignore_changes        = [
      tags["kubernetes.io"]
    ]
  }
}
On modules/vpc/vpc.tf line 12: Argument names must not be quoted.

Changing the resource to the following snippet where I unquote the kubernetes.io argument throws a different error.

resource "aws_vpc" "ct" {
  cidr_block                       = "${var.vpc_cidr_ipv4}"
  assign_generated_ipv6_cidr_block = "true"
  instance_tenancy                 = "default"
  enable_dns_support               = true
  enable_dns_hostnames             = true

  tags {
    Name       = "${var.infra_name}_${replace(var.region,"-","")}"
    TERRAFORM  = "true"
    INFRA_NAME = "${var.infra_name}"
    kubernetes.io = "unset"
  }

  lifecycle {
    create_before_destroy = true
    ignore_changes        = [
      tags["kubernetes.io"]
    ]
  }
}
Error: Argument or block definition required

On modules/vpc/vpc.tf line 12: An argument or block definition is required
here. To set an argument, use the equals sign "=" to introduce the argument
value.

I'm not sure how to proceed here.

Steps to Reproduce

Please list the full steps required to reproduce the issue, for example:

  1. terraform init
  2. terraform plan

References

@pgporada
Copy link
Author

If I remove "kubernetes.io" = "unset"/kubernetes.io = "unset" from the tags block, then terraform progresses.

@pgporada
Copy link
Author

Disregard, this was an issue during my upgrade from 0.11.14 to 0.12.4 where the tags { block should have been tags = {

@ghost
Copy link

ghost commented Aug 16, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Aug 16, 2019
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

1 participant