Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Confusing error in HCL1-style map #84

Closed
radeksimko opened this issue Feb 6, 2019 · 2 comments
Closed

Confusing error in HCL1-style map #84

radeksimko opened this issue Feb 6, 2019 · 2 comments
Labels

Comments

@radeksimko
Copy link
Member

provider "aws" {
  region = "us-west-2"
  profile = "tf"
}

resource "aws_elasticsearch_domain" "example" {
  domain_name           = "example"
  elasticsearch_version = "1.5"

  cluster_config {
    instance_type = "r4.large.elasticsearch"
  }

  advanced_options {
    "rest.action.multi.allow_explicit_index" = true
  }

  snapshot_options {
    automated_snapshot_start_hour = 23
  }

  tags = {
    Domain = "TestDomain"
  }
}
Terraform v0.12.0-dev
$ terraform plan
Error: Invalid argument name

  on main.tf line 15, in resource "aws_elasticsearch_domain" "example":
  15:     "rest.action.multi.allow_explicit_index" = true

Argument names must not be quoted.

advanced_options here is TypeMap, which means we expect =, but that's not what the error suggests.

@radeksimko radeksimko added the bug label Feb 6, 2019
@apparentlymart
Copy link
Contributor

Some more discussion on this over in hashicorp/terraform#19240.

@apparentlymart
Copy link
Contributor

The corresponding issue over in Terraform was closed by teaching Terraform's upgrade tool to deal with this, since ultimately this is a problem of ambiguity during upgrade rather than a defect in HCL 2. Therefore I'm going to close this now, because there isn't really anything we can do about it without leaking application-specific implementation details into this error message that comes from the HCL 2 parser.

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

No branches or pull requests

2 participants