1

I am trying to visualize the historical gap (on 3 previous months) between the on-demand and the spot prices of aws ec2 instances. I am already able to get the spot prices history with the following straight-forward code snippet, is it possible to also get the on-demand prices as simply as that?

import boto3
client.describe_spot_price_history(
    InstanceTypes = ['m4.large'],
    ProductDescriptions = ['Linux/UNIX (Amazon VPC)']
)

I read this discussion about a walk around to get a demand price at a specific time. Although it is all built into boto3 and easy to use, it fetch on-demand price at current time and does not retrieve history, as for spot instances. Is there a simple solution here? Is it safe to take the current on-demand price as a proxy for last 3 months? Or does it fluctuate too much?

Dime
  • 41
  • 6

0 Answers0