VladRassokhin / intellij-hcl

HCL language support for IntelliJ platform based IDEs
Apache License 2.0
244 stars 47 forks source link

Support provider alias as data type with tf 0.12 #210

Closed albuch closed 5 years ago

albuch commented 5 years ago

Installation details

Terraform Configuration Files

provider "aws" {
  alias   = "iam"
  region  = var.region
  version = "~> 2.12.0"
}

resource "aws_iam_user" "test" {
  name          = "test"
  path          = "/"

  provider = aws.iam
}

module "test" {
  source = "./modules/test"
  providers = {
    aws.target = aws.iam
  }
}

Exception

For resource:
Unresolved reference iam

For module:
<property> expected, got '.'
Unresolved reference iam
<identifier> or <string literal> expected, got '}'

Expected Behavior

Plugin should not report a validation error for provider alias data type when not defined as a string literal. For Modules provider target alias should not be reported as an error if not defined as a string literal.

Actual Behavior

Provider alias is reported as error, see exception section.

VladRassokhin commented 5 years ago

Fixed in 0.7.1, will be released shortly