Hi Infracost team, I’ve encountered an issue where...
# help
l
Hi Infracost team, I’ve encountered an issue where the Infracost GraphQL API does not return Spot pricing for certain i7i instance types (e.g., i7i.xlarge and i7i.2xlarge), even though these Spot prices are available on the AWS EC2 Spot Pricing page (https://aws.amazon.com/ec2/spot/pricing/). This is working fine for
on_demand
instance though Example Query:
Copy code
query {
  products(
    filter: {
      vendorName: "aws"
      service: "AmazonEC2"
      productFamily: "Compute Instance"
      region: "us-east-1"
      attributeFilters: [
        { key: "instanceType", value: "i7i.2xlarge" }
        { key: "operatingSystem", value: "Linux" }
        { key: "licenseModel", value: "No License required" }
        { key: "tenancy", value: "Shared" }
        { key: "capacitystatus", value: "Used" }
        { key: "preInstalledSw", value: "NA" }
      ]
    }
  ) {
    prices(filter: { purchaseOption: "spot" }) {
      USD
    }
  }
}
what is the reason for this?
s
Thanks very much! We're looking into it, I'll follow up soon when we have more info
l
Thank you!
l
@little-apple-76419 thanks for reporting this. Can you check if it is working for you now?
l
still the same response @little-author-61621
Copy code
{
  "data": {
    "products": [
      {
        "prices": []
      }
    ]
  }
}
l
@little-apple-76419 are you able to try again? The following is now working for me:
Copy code
curl -X POST \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $INFRACOST_API_KEY" \
  -d '{
    "query": "query($productFilter: ProductFilter!, $priceFilter: PriceFilter) { products(filter: $productFilter) { region, prices(filter: $priceFilter) { priceHash USD } } }",
    "variables": {
      "priceFilter": {
        "purchaseOption": "spot"
      },
      "productFilter": {
        "vendorName": "aws",
        "service": "AmazonEC2",
        "productFamily": "Compute Instance",
        "region": "us-east-1",
        "attributeFilters": [
          {
            "key": "instanceType",
            "value": "i7i.xlarge"
          },
          {
            "key": "operatingSystem",
            "value": "Linux"
          },
          {
            "key": "licenseModel",
            "value": "No License required"
          },
          {
            "key": "tenancy",
            "value": "Shared"
          },
          {
            "key": "capacitystatus",
            "value": "Used"
          },
          {
            "key": "preInstalledSw",
            "value": "NA"
          }
        ]
      }
    }
l
it's working for me now! not sure why it wasn't earlier Thank you so much @little-author-61621
l
It looks like AWS updated the endpoint for spot pricing, but also kept the old one working and then it just took a while to propagate on our side. Thanks for reporting and confirming!