cycloidio / terracost

Cloud cost estimation for Terraform in your CLI
MIT License
278 stars 29 forks source link

Enable estimating cost from terraform references #77

Open marcoldp opened 1 year ago

marcoldp commented 1 year ago

As of now, the estimate only works when the resources variables are set directly and not via reference. The goal of this issue is to find a way to enable this behavior and allow to estimate resources that have variables set via reference to other resources or data.

olivier2t commented 1 year ago

For example if the location comes from a resource group fetched with a datasource, which is a common way of doing in Azure IaC.

resource "azurerm_linux_virtual_machine" "nexus" {
...
  resource_group_name   = data.azurerm_resource_group.nexus.name
  location              = data.azurerm_resource_group.nexus.location
...
}