VladRassokhin / intellij-hcl

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

Conflicting count and providers in module implementation #353

Closed antonstamenov closed 3 years ago

antonstamenov commented 3 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

module "dummy" {
  count  = local.create_vpc ? 1 : 0
  source = "./"
  providers = {
    aws = aws.shd
  }
}

Exception

The code is highlighted as an error, while it is deployable and works ok.
Screenshot 2021-09-02 at 16 31 31

Expected Behavior

Accept both count and providers. Seems like they work.

There is this text in the documentation, but it is about providers defined into the modules, not the ones that are defined in the callee.

A module containing its own provider configurations is not compatible with the for_each, count, and depends_on arguments that were introduced in Terraform v0.13. For more information, see Legacy Shared Modules with Provider Configurations.

Actual Behavior

There is an error indication about conflicting properties.

Steps to Reproduce

Paste the above code in a file in an empty folder and open it with the IDE.

VladRassokhin commented 3 years ago

Duplicates #311.