Interpolation of for_each iterator is marked as an error
See original GitHub issuePrerequisites
- Ensure you have latest version of plugin installed
- Search for possible issue duplicates
Installation details
- IDE version (
Help->About->Copy to Clipboard
) - intellij-hcl plugin version (
Settings->Plugins
) 0.7.5 - Terraform version (
terraform -v
) 0.12.7
IntelliJ Version details
IntelliJ IDEA 2019.2.1 (Ultimate Edition) Build #IU-192.6262.58, built on August 21, 2019 Licensed to Gareth Jones Subscription is active until June 22, 2020 Runtime version: 11.0.2+9-b226.7 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0 GC: ParNew, ConcurrentMarkSweep Memory: 1981M Cores: 8 Registry: analyze.exceptions.on.the.fly=true, java.completion.argument.hints.internal=false, git.use.builtin.ssh=true, debugger.watches.in.variables=false, completion.stats.show.ml.ranking.diff=true Non-Bundled Plugins: CMD Support, Key Promoter X, PsiViewer, Switch Structure, com.alayouni.ansiHighlight, com.intellij.apacheConfig, com.jetbrains.foldOtherMethods, com.jetbrains.plugins.ini4idea, com.intellij.plugins.watcher, lermitage.intellij.battery.status, mobi.hsz.idea.gitignore, net.seesharpsoft.intellij.plugins.csv, net.vektah.codeglance, org.asciidoctor.intellij.asciidoc, org.elixir_lang, org.intellij.plugins.hcl, Karma, com.dmarcotte.handlebars, com.intellij.lang.jsgraphql, com.intellij.plugins.html.instantEditing, com.intellij.plugins.webcomponents, com.jetbrains.lang.ejs, com.jetbrains.plugins.jade, com.jetbrains.php, com.jetbrains.php.blade, com.jetbrains.php.drupal, com.jetbrains.php.wordPress, com.jetbrains.twig, de.espend.idea.laravel, net.king2500.plugins.PhpAdvancedAutoComplete, cucumber-javascript, intellij.prettierJS, org.intellij.scala, org.jetbrains.plugins.go, org.jetbrains.plugins.phpstorm-remote-interpreter, org.jetbrains.plugins.vagrant, org.jetbrains.plugins.vue, Dart, org.jetbrains.plugins.node-remote-interpreter, Pythonid, com.emberjs, com.raket.silverstripe, org.jetbrains.plugins.ruby, jones.foldtestblocks.fold-test-blocks, org.psliwa.idea.composer, org.sylfra.idea.plugins.linessorter, org.toml.lang, org.rust.lang, ru.adelf.idea.dotenv, uk.co.ben-gibson.remote.repository.mapperTerraform Configuration Files
locals {
admin_locations = [
{
cidr_range = "xx.xxx.xxx.xxx/xx",
description = "Office"
}
]
}
# Allow SSH from our designated admin locations
dynamic "ingress" {
for_each = local.admin_locations
iterator = location
content {
from_port = 22
to_port = 22
protocol = "tcp"
description = "${location.value.description} (MySQL access)"
}
}
Exception
None, nor anything in the logs.
Expected Behavior
No errors.
Actual Behavior
${location.value.description}
is marked w/ the error “Unknown resource type”.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
- Write sample code into
.tf
file
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Cannot assign to item because it is a foreach iteration variable
EDIT: This question is different to the possible duplicate because it's asking why we can't modify the iteration variable when behind the scenes ......
Read more >Data factory - ForEach Activity error - Next on empty iterator
I have created a pipeline with two nested foreach activities. The first one is extracting a list of files to load. The second...
Read more >Template literals (Template strings) - JavaScript | MDN
Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded ...
Read more >Perl | Loops (for, foreach, while, do...while, until, Nested loops)
A foreach loop is used to iterate over a list and the variable holds the value of the elements of the list one...
Read more >Loop variable built-ins - Apache FreeMarker Manual
Hence, this is a parsing error: ... Tells if the item where the iteration (which is identified by the loop variable name) currently...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually it’s already fixed as part of #224 fix, though not released. Will be available in 0.7.6
This still happens with
for
:In the above
dvo.domain_name
& co are marked as errors, withdvo
being marked with warning ("unknown resource’), and the properties being marked as errors (“unresolved reference”).