AWS EC2 Spot. My Spot Max Bid Price - 2$. Current Spot Price - 1$. How much I'll pay for instance? 2$ per hour or 1$ (and increasing|decreasing), equal to Current spot price, while my bid price is less than current (and get an error if current is more than my bid). Thanks!
At the beginning of each hour that a spot instance is running (instance hour, not wall-clock hour), the current spot price for instances of that type and availability zone is captured, and you pay that price for that hour. The next hour, and each hour after that, the process repeats. If the market price rises above your bid while the instance is running, the spot instance is terminated, but not sooner than 2 minutes after the price shifts. What happens after that depends on whether the spot request was persistent and how you configured termination/hybernation behavior.
Spot instances can also be termimated at any time without a price change, if the capacity is no longer available, such as can happen due to an increase in the number of on-demand instances, causing the size of the available spot pool to be reduced. Available capacity changes do not necessarily correlate with an immediate change in the market price. This did happen prior to the change in the spot price algorithm in late 2017 but spot price fluctuations are now dampened -- more loosely coupled to demand -- to prevent the sometimes dramatic price volatility (and presumably some market gaming) that occured with the old algorithm.