06/13/2022, 10:26 AM
Hey guys. I’m to get the newer version of infracost reading my HCL but I get the following error (in 🧵 ). Does anyone know what’s wrong?
Detected Terraform project at /Users/vutoff/Projects_Git/RBank/aws-terraform/dr/monolith
  ✔ Downloading Terraform modules
  ✔ Evaluating Terraform directory

Error: An unexpected error occurred

not a number
goroutine 27 [running]:
	runtime/debug/stack.go:24 +0x65
	<|> +0x46
panic({0x270c6c0, 0x311fd50})
	runtime/panic.go:838 +0x207
<|>{{{0x313a1e8?, 0xc0001a7ada?}}, {0x270c6c0?, 0xc0034c4e30?}})
	<|> +0x145
	<|> +0x112
<*HCLProvider).getResourceOutput(_|*HCLProvider).getResourceOutput(_>, _)
	<|> +0x77a
<*HCLProvider).marshalModule|*HCLProvider).marshalModule>(0xc00076ed20, 0xc001c817d8)
	<|> +0x265
<*HCLProvider).marshalModule(0xc00076ed20|*HCLProvider).marshalModule(0xc00076ed20>, 0xc0006ac038)
	<|> +0x77b
<*HCLProvider).modulesToPlanJSON(0xc00076ed20|*HCLProvider).modulesToPlanJSON(0xc00076ed20>, 0xc0005d1aa0?)
	<|> +0x166
	<|> +0xa5
<*HCLProvider).LoadResources(0xc00020ee40|*HCLProvider).LoadResources(0xc00020ee40>?, 0xc0001a0010?)
	<|> +0x35
main.(*parallelRunner).runProjectConfig(0xc0003de9c0, 0xc00060c000)
	<|> +0x1109
	<|> +0x1c5
	<|> +0x67
created by <*Group).Go|*Group).Go>
	<|> +0x8d

Infracost v0.10.3

An unexpected error occurred. We've been notified of it and will investigate it soon. If you would like to follow-up, please copy the above output and create an issue at: <>


06/13/2022, 10:28 AM
Hey @bulky-jackal-21121 👋
This looks like Infracost is struggling to evaluate the
attributes in your project. I think this could be two problems: 1. you’re using an expression in HCL which is evaluated as
because Infracost can’t resolve it for some reason. We’ll need some more info to try and debug this. 2. You’re setting a count attribute to a string somewhere in your infrastructure and Infracost is struggling to convert this. Either way, we definitely need to not panic here and give you a better output! 🙃 Do you mind opening an issue on our repo here: so that we can track this and direct other users to it if they’re having problems. We can continue the discussion there and try and find out what the root cause is. As a workaround, until we get this fixed, you can use the
flag for you project. This uses the Terraform binary to get outputs from your project. You can read more about the workaround here


06/13/2022, 11:24 AM
Thanks, Hugo. I’ll try it.