amazon web services - How to get the price of a running EC2 spot instance? -


i trying create ec2 spot instances using boto3 api, far able spot instance history price, spin spot instance, etc.

but don't know how price paying spot instance using boto api.

anyone know how ?

thanks

when launching spot instance under amazon ec2, specify maximum hourly price, known bid. maximum price charged instance.

when instance launched, , on each hourly anniversary of instance being in running state, instance charged @ then-current spot price.

if instance terminated due spot price rising above bid price, there no charge partial hour instance terminated. however, if user terminates spot instance, partial hour will charged.

therefore, "the price paying spot instance" price @ start of each hour. calculated @ time charge takes place.

to obtain price charged spot instance, use spot instance data feed provides data feed describes spot instance usage , pricing. data feed sent amazon s3 bucket specify when subscribe data feed. updated hourly.


Comments