hey team, I am trying to use the Infracost pricing...
# help
h
hey team, I am trying to use the Infracost pricing api to get cost of node instance. But I am facing few mismatch in the pricing publicly available and the pricing being returned by the api. Can anyone please help me with this? Request:
Copy code
query {
  products(
    filter: {
      vendorName: "gcp"
      region: "europe-west4"
      attributeFilters: [{ key: "machineType", value: "a2-highgpu-1g" }]
    }
  ) {
    prices {
      USD
    }
  }
}
Response:
Copy code
{
  "data": {
    "products": [
      {
        "prices": [
          {
            "USD": "0.814064"
          },
          {
            "USD": "0.32565"
          }
        ]
      }
    ]
  }
}
But according to GCP https://gcloud-compute.com/a2-highgpu-1g.html it should be around
3.6734
and `1.2058`USD
l
Thanks @happy-father-98665, yeah this looks wrong. I’ll have a look into it.
@happy-father-98665 we have a fix for this released now, let me know if you are still seeing issues.
h
Thanks a lot @little-author-61621 I checked, but I am still getting the same response for the above query. Can you please check if the changes are released for this endpoint
<https://pricing.api.infracost.io/graphql>
l
@happy-father-98665 it’s working for me now. If you use the following query with the
service
and
productFamily
filters as well it improve the performance:
Copy code
query {
  products(
    filter: {
      vendorName: "gcp"
      region: "europe-west4"
      service: "Compute Engine"
      productFamily: "Compute Instance"
      attributeFilters: [{ key: "machineType", value: "a2-highgpu-1g" }]
    }
  ) {
    prices {
      USD
    }
  }
}
h
Thanks a lot @little-author-61621, now its working for me as well