I've created a small python script that is just querying the AWS spot pricing for certain instances, this was working yesterday and has been for the past week. However despite using different credentials the machine I'm running this against is receiving the following error:
aws_query = client.describe_spot_price_history(
StartTime=today,
EndTime=today,
InstanceTypes=[
'g2.2xlarge'
],
ProductDescriptions=[
'Linux/UNIX',
],
MaxResults=3
)
This returns the following:
botocore.exceptions.ClientError: An error occurred (AuthFailure) when calling the DescribeSpotPriceHistory operation: AWS was not able to validate the provided access credentials
I understand the error, but it makes no sense. The IAM role associated with the instance this is running from definitely has permissions to do this.
There have been no changes that I can think of that would impact this.
Note, this script runs from my local machine fine.
Does anyone have any ideas what may have caused this?
As an alternative - Does anyone know how I can ask Boto3 to confirm the credentials it is using?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…