Channels
  • j

    Jimmy

    2 months ago
    Hi team, Regarding to issue https://github.com/infracost/infracost/issues/421, I would like to know the usage file format of google_compute_address/google_compute_global_address because it’s not quite clear in the doc. I want to use just one type of the IP address, how can I specify it in usage file. The current output is
    ├─ IP address (if used by standard VM)                                                    730  hours                  $2.92 
     ├─ IP address (if used by preemptible VM)                                                 730  hours                  $1.46 
     └─ IP address (if unused)                                                                 730  hours                  $0.00
  • Ali (Infracost)

    Ali (Infracost)

    2 months ago
    Hi @Jimmy - great question! In the reference usage-file we don’t have that resource as we didn’t think of that edge-case when defining that resource’s pricing. This is the schema that’s used to define that’s resource’s prices, we’d need to add a string address_type param, similar to something like this, so users can define that in the usage-file. Plz let us know if this is something you’d like to work on and the team’ll be happy to help
  • j

    Jimmy

    2 months ago
    yes, that will help. We’d like to show the planned cost based on a certain situation to help the users get a basic understanding of their cost. Although the use case of IP address can change dynamically, it will be better considered in runtime cost.
  • Vadim (Infracost)

    Vadim (Infracost)

    2 months ago
    Hey @Jimmy! If Ail's proposed solution works for your case, are you willing to make the change for the resource? We have a section in our contributing guide how to do it: https://github.com/infracost/infracost/blob/master/contributing/add_new_resource_guide.md#add-usage-based-cost-components.
    If not, no worries 🙂 I created a GH issue, so you can follow the progress there or if you have more details/suggestion, please add them in comments https://github.com/infracost/infracost/issues/1572
    FYI, I went ahead and added the param. Could you please take a look and tell if this works for you? https://github.com/infracost/infracost/pull/1573/files#diff-37ce8c61de6c3efc76d2b3e67cb04e69193f112c62466f654fb429186aa486ecR13
  • Ali (Infracost)

    Ali (Infracost)

    2 months ago
    That’s awesome Vadim! I wonder if we should put the type in brackets: IP address (standard VM) or IP address (preemptible VM) or IP address (unused)
  • Vadim (Infracost)

    Vadim (Infracost)

    2 months ago
    Sure thing, I'll update it 👍
    @User Just a heads-up: the change is merged to master and will go live with the next release in a week or two. Thank you for the suggestion, keep it coming! 🙂