I can connect to an AWS region but am not authorized to get the spot prices
<p>I am trying to get AWS spot price history and I have been getting help from this tutorial: <a href="https://medium.com/cloud-uprising/the-data-science-of-aws-spot-pricing-8bed655caed2#.nk3k2m1z0" rel="nofollow">https://medium.com/cloud-uprising/the-data-science-of-aws-spot-pricing-8bed655caed2#.nk3k2m1z0</a></p>

<p>I am able to connect to the given region as I get back the connection object.</p>

<p>But I get an error when I reach the following line:</p>

<pre><code>prices = ec2.get_spot_price_history(start_time=start, end_time=end, instance_type=instance)
</code></pre>

<p>This is the error I get:</p>

<pre><code>will process from 2016-05-26T00:00:00 to 2016-05-26T11:59:59
EC2Connection:ec2.us-east-1.amazonaws.com
Traceback (most recent call last):
  File "test.py", line 30, in &lt;module&gt;
    prices = conn.get_spot_price_history(start_time=start, end_time=end, instance_type=instance_types[0])
  File "/usr/lib/python2.7/dist-packages/boto/ec2/connection.py", line 1420, in get_spot_price_history
    [('item', SpotPriceHistory)], verb='POST')
  File "/usr/lib/python2.7/dist-packages/boto/connection.py", line 1186, in get_list
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 401 Unauthorized
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Response&gt;&lt;Errors&gt;&lt;Error&gt;&lt;Code&gt;AuthFailure&lt;/Code&gt;&lt;Message&gt;AWS was not able to validate the provided access credentials&lt;/Message&gt;&lt;/Error&gt;&lt;/Errors&gt;&lt;RequestID&gt;70a8b7bd-28e2-4526-83df-d0cb86e1f491&lt;/RequestID&gt;&lt;/Response&gt;
</code></pre>

<p>Can anyone tell my how is it possible that i can connect but am not authorized?</p>

<p>I figured out the problem. It turns out my pc time was 7 minutes slower. and I read somewhere that AWS in addition to your credentials also uses your CPU time.</p>

<p>Basically I manually changed the time, and now it works:)</p>

python amazon-web-services amazon-ec2 boto unauthorized