https://infracost.io logo
#help
Title
# help
a

ambitious-book-89337

03/06/2023, 2:22 PM
Hi gents, I was trying to setting the override location in the config file, but wehn I run the breakdown, it still fallsbacks to aadefault region eastus, different from the one I set as default, any clue why? This si also caused probably because infracost can't seem to find an indexed resource like this: "Using eastus for resource azurerm_storage_account.test_reports[\"uksouth\"] as its 'location' property could not be found." those backslashes are probably the reason infracost can't find the resource, although it exists, (and deployed) Thread in #general
m

mysterious-teacher-68276

03/06/2023, 2:23 PM
Hey @ambitious-book-89337 - how is the
location
property set on this
azurerm_storage_account
?
could you post some hcl code, with any secrets obfuscated/removed
a

ambitious-book-89337

03/06/2023, 2:24 PM
location = data.azurerm_resource_group.primary["${each.key}"].location
this resource is inside a for_each
m

mysterious-teacher-68276

03/06/2023, 2:25 PM
ok so we don’t support
data
blocks when parsing hcl directly. This is because we don’t use credentials to fetch information from your provider.
so in this case we just fallback to the default
a

ambitious-book-89337

03/06/2023, 2:25 PM
sure
I guesed it could be it
but I'm already trying to override a default
by using this: INFRACOST_AZURE_OVERRIDE_REGION: uksouth
m

mysterious-teacher-68276

03/06/2023, 2:26 PM
ah sorry
a

ambitious-book-89337

03/06/2023, 2:26 PM
but seems to be doing nothing 😕
m

mysterious-teacher-68276

03/06/2023, 2:26 PM
let me take a peek
a

ambitious-book-89337

03/06/2023, 2:26 PM
this env is being passed inside infracost config file
m

mysterious-teacher-68276

03/06/2023, 2:27 PM
what happens if you pass this directly
i.e.
INFRACOST_AZURE_OVERRIDE_REGION=uksouth  infracost breakdown --config-file
a

ambitious-book-89337

03/06/2023, 2:28 PM
worked like a charm
so, using it in the config file does not work 😞
m

mysterious-teacher-68276

03/06/2023, 2:29 PM
yeah I’m not sure we allow it to be at the moment
but could you raise an issue just so I can track and check
a

ambitious-book-89337

03/06/2023, 2:30 PM
for sure, many thanks for this one, not sure this is an improvement or issue
m

mysterious-teacher-68276

03/06/2023, 2:30 PM
open it as an issue and i’ll change accordingly
a

ambitious-book-89337

03/06/2023, 2:31 PM
the config file docs, state we can declare environment variables there, doesn't mention any restriction but maybe the override is processed before parsing the config file
m

mysterious-teacher-68276

03/06/2023, 2:32 PM
I think these are meant to be for non Infracost envs
INFRACOST
prefixed variables I don’t think are supported in that env
but I’ll take a peek with the issue
a

ambitious-book-89337

03/06/2023, 2:38 PM
all done, would be a nice to have 🙂
many thanks for your help Hugo 💪