【发布时间】:2016-09-16 03:54:22
【问题描述】:
我正在尝试获取 AWS 现货价格历史记录,并从本教程中获得了帮助:https://medium.com/cloud-uprising/the-data-science-of-aws-spot-pricing-8bed655caed2#.nk3k2m1z0
当我取回连接对象时,我能够连接到给定的区域。
但是当我到达以下行时出现错误:
prices = ec2.get_spot_price_history(start_time=start, end_time=end, instance_type=instance)
这是我得到的错误:
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 <module>
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
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not able to validate the provided access credentials</Message></Error></Errors><RequestID>70a8b7bd-28e2-4526-83df-d0cb86e1f491</RequestID></Response>
谁能告诉我,我怎么可能连接但没有被授权?
【问题讨论】:
-
创建连接不会执行任何网络请求或验证您的凭据。
标签: python amazon-web-services amazon-ec2 boto unauthorized