Goober
Goober

Reputation: 13508

Amazon Web Services REST Api Issues

I want to hook into the Amazon Web Services REST Api to check the status of my EC2 Instances.

I'm using the following link for reference (which doesn't seem to be particularly straightforward) - AWS EC2 API

I'm executing the following in browser -

https://ec2.amazonaws.com/?AWSAccessKeyId=[INSERTACCESSKEYIDHERE]&Action=DescribeInstanceStatus&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-04-03T20%3A55%3A06Z&Version=2014-10-01

The result I get back is -

<Response>
<script id="tinyhippos-injected"/>
<Errors>
<Error>
<Code>AuthFailure</Code>
<Message>
AWS was not able to validate the provided access credentials
</Message>
</Error>
</Errors>
<RequestID>00e540d7-e339-4475-8fb9-5fd49d72278d</RequestID>
</Response>

........Fine, it doesn't validate the credentials....but at what point does it explain how to do this in the reference documentation?

Upvotes: 0

Views: 327

Answers (1)

Michael - sqlbot
Michael - sqlbot

Reputation: 178956

Your request is missing &Signature=... (at least, and perhaps other elements).

That's documented at http://docs.aws.amazon.com/general/latest/gr/signature-version-2.html

See also http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html

Also, FWIW, EC2's API isn't technically a REST API, it's a Query API.

Upvotes: 1

Related Questions