Hi gents, I was trying to setting the override lo...
# help
a
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
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
location = data.azurerm_resource_group.primary["${each.key}"].location
this resource is inside a for_each
m
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
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
ah sorry
a
but seems to be doing nothing 😕
m
let me take a peek
a
this env is being passed inside infracost config file
m
what happens if you pass this directly
i.e.
INFRACOST_AZURE_OVERRIDE_REGION=uksouth  infracost breakdown --config-file
a
worked like a charm
so, using it in the config file does not work 😞
m
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
for sure, many thanks for this one, not sure this is an improvement or issue
m
open it as an issue and i’ll change accordingly
a
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
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
all done, would be a nice to have 🙂
many thanks for your help Hugo 💪