question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Unresolved reference arn` for `arn` member in `aws_codeartifact_domain` and `aws_codeartifact_repository` objects

See original GitHub issue

Prerequisites

  • Ensure you have latest version of plugin installed
  • Search for possible issue duplicates

Installation details

  • IDE version (Help->About->Copy to Clipboard)
WebStorm 2020.3.2
Build #WS-203.7148.54, built on January 25, 2021
Runtime version: 11.0.9.1+11-b1145.77 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1953M
Cores: 8
Registry: ide.intellij.laf.enable.animation=true, ide.balloon.shadow.size=0
Non-Bundled Plugins: com.mallowigi.idea, org.intellij.plugins.hcl
  • intellij-hcl plugin version (Settings->Plugins)
HashiCorp Terraform / HCL language Support
0.7.10
  • Terraform version (terraform -v)
Terraform v0.14.5
+ provider registry.terraform.io/hashicorp/aws v3.25.0

Terraform Configuration Files

# Make a codeartifact domain and attach a repository to it
resource "aws_codeartifact_domain" "a_certain_code_domain" {
  domain         = "a-certain-code-domain"
}

resource "aws_codeartifact_repository" "a_certain_code_repository" {
  repository = "a-certain-code-repository"
  domain     = aws_codeartifact_domain.a_certain_code_domain.domain
}

# Now try to use the arn of the above generated resources, for instance for a iam policy
resource "aws_iam_policy" "a_certain_attached_policy" {
  name        = "CodeBuildBasePolicyForACertainModule"
  policy = jsonencode(
  {
    Version: "2012-10-17",
    Statement: [
      {
        Effect: "Allow",
        Action: [
           "codeartifact:GetAuthorizationToken",
           "codeartifact:GetRepositoryEndpoint",
        ]
        Resource: [
           aws_codeartifact_domain.a_certain_code_domain.arn,   # [!] Unresolved reference arn 
           aws_codeartifact_repository.a_certain_code_repository.arn  # [!] Unresolved reference arn 
        ]
     }
   ]
 })
}

Exception

None

Expected Behavior

  • What should have happened? aws_codeartifact_domain and aws_codeartifact_repository objects provide correctly their members information for correct code highlighting

Actual Behavior

What actually happened? HCL language support plugin prompts an error Unresolved reference arn for arn member in aws_codeartifact_domain and aws_codeartifact_repository objects even when the configuration is totally valid

Steps to Reproduce

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

  1. Setup a new project with the above terraform configuration
  2. Check code static analysis from HCL language support plugin, 2 errors prompted

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
VladRassokhincommented, Sep 3, 2021

Fixed in 0.7.11

0reactions
isleshocky77commented, Sep 30, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found