We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When testing a module call which passes through the following input:
filename = "${path.module}/${var.filename}"
It triggers an infinite loop when var.filename is used in a templatefile call inside the module.
var.filename
templatefile
The attached zip file contains a simple example to demonstrate the issue. recursive_loop_error.zip
Running Terrascan in debug mode on this gives the following when the infinite loop starts:
2021-04-16T14:29:30.379Z debug commons/resource.go:62 created resource config for resource 'example', file: '/src/recursive_loop_error/dummy/main.tf' 2021-04-16T14:29:30.379Z debug commons/variable-references.go:109 resolving variable ref "${templatefile(\n var.filename,\n {\n foo = \"bar\"\n }\n )}" in parent module call 2021-04-16T14:29:30.379Z debug commons/variable-references.go:57 extracted variable name "filename" from reference "${templatefile(\n var.filename,\n {\n foo = \"bar\"\n }\n )}" 2021-04-16T14:29:30.382Z debug commons/variable-references.go:155 resolved str variable ref: '${templatefile( var.filename, { foo = "bar" } )}', value: '${templatefile( ${path.module}/${var.filename}, { foo = "bar" } )}' 2021-04-16T14:29:30.382Z debug commons/variable-references.go:109 resolving variable ref "${templatefile(\n ${path.module}/${var.filename},\n {\n foo = \"bar\"\n }\n )}" in parent module call 2021-04-16T14:29:30.382Z debug commons/variable-references.go:57 extracted variable name "filename" from reference "${templatefile(\n ${path.module}/${var.filename},\n {\n foo = \"bar\"\n }\n )}" 2021-04-16T14:29:30.386Z debug commons/variable-references.go:155 resolved str variable ref: '${templatefile( ${path.module}/${var.filename}, { foo = "bar" } )}', value: '${templatefile( ${path.module}/${path.module}/${var.filename}, { foo = "bar" } )}' 2021-04-16T14:29:30.387Z debug commons/variable-references.go:109 resolving variable ref "${templatefile(\n ${path.module}/${path.module}/${var.filename},\n {\n foo = \"bar\"\n }\n )}" in parent module call 2021-04-16T14:29:30.388Z debug commons/variable-references.go:57 extracted variable name "filename" from reference "${templatefile(\n ${path.module}/${path.module}/${var.filename},\n {\n foo = \"bar\"\n }\n )}" 2021-04-16T14:29:30.389Z debug commons/variable-references.go:155 resolved str variable ref: '${templatefile( ${path.module}/${path.module}/${var.filename}, { foo = "bar" } )}', value: '${templatefile( ${path.module}/${path.module}/${path.module}/${var.filename}, { foo = "bar" } )}'
If you need any more information please contact me.
Edited to sort out link to Zip file.
The text was updated successfully, but these errors were encountered:
patilpankaj212
Successfully merging a pull request may close this issue.
When testing a module call which passes through the following input:
It triggers an infinite loop when
var.filename
is used in atemplatefile
call inside the module.The attached zip file contains a simple example to demonstrate the issue. recursive_loop_error.zip
Running Terrascan in debug mode on this gives the following when the infinite loop starts:
If you need any more information please contact me.
Edited to sort out link to Zip file.
The text was updated successfully, but these errors were encountered: