3 ms·
$terraform console >var.whatever "its value" >whatever_resource.foo.whatever_attr "its value" If you mean somehow printing things when the configuratio
by OJFord 2y ago
$terraform console
>var.whatever
"its value"
>whatever_resource.foo.whatever_attr
"its value"
If you mean somehow printing things when the configuration is being applied... I think you just need to understand that it's neither a procedural language (it's declarative) nor general-purpose (it's infrastructure configuration).
- nightpool 2y agoThis works great for toy examples and fails the moment you have 1 (one) module
- OJFord 2y agoIt doesn't fail, but you're right you can't reach inside submodules with terraform console; I wish you could.
- nightpool 2y agoIt "fails" in that I cannot use it to debug my code or print out outputs like the . In general, Terraform's debuggability story is very poor, and the DX tools (like the VS Code plugin) are lacking
- SOLAR_FIELDS 2y agoDeclarative language can absolutely print out what it does know at the time. Which of course won’t be everything. But if I’m taking an input and morphing it at runtime like looping or just moving the information around in a data structure which terraform absolutely allows you to do, the runtime of terraform has all that information. I just can’t get it out. Plus, there are many times I don’t want to have to use the REPL. Maybe I’m in CI or something. The fact that I cannot iterate over values of locals and variables easy to see what they are in say, some nested list or object, easily and just print out the values as I’m going along for the things terraform does know is just crappy design