VladRassokhin / intellij-hcl

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

Resource existence detection not working for certain resources #290

Closed fredo838 closed 4 years ago

fredo838 commented 4 years ago

Thank you for opening an issue. In this template paragraph text could be removed, however please retain headers.

Prerequisites

Installation details

Terraform Configuration Files

resource "google_cloud_run_service" "endpoints_service" {
  name = local.esp_name
  location = "europe-west1"
  project = var.project
  template {
    spec {
      containers {
        image = "gcr.io/endpoints-release/endpoints-runtime-serverless:2"
        /*
        env {
          name = "ENDPOINTS_SERVICE_NAME"
          value = data.external.dummy_creator.result.URL
        }
        */
      }
    }
  }
}

resource "null_resource" "debug" {
  provisioner "local-exec" {
    command = "bash -c 'echo ${google_cloud_run_service.endpoints_service.status.0.url}'"
  }
}

Expected Behavior

Values are blue.

Actual Behavior

The values should not be marked as not detected. They are marked red, as if they don't exist, but they do exist, and terraform apply works fine.

image

Steps to Reproduce

  1. Install the plugin in Pycharm IDE
  2. Install provider "google"
  3. define the google provider in provider.tf:
    provider "google" {
    }
  4. Create the two resources defined above in main.tf.
  5. Look at the colour of the .status.0.url. Note, .id does get marked as blue (existing).
VladRassokhin commented 4 years ago

Fixed with schema update in 0.7.8