Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The action DescribeImageAttribute is not valid for this web service

I am trying to fetch the product codes of my AWS AMI, and as per http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImageAttribute.html, i generated the request and fired it. and i get this response.

<Response>
<Errors>
<Error>
<Code>InvalidAction</Code>
<Message>
The action DescribeImageAttribute is not valid for this web service.
</Message>
</Error>
</Errors>
<RequestID>b17b3f04-f7e6-47c7-a379-cb3d9a902865</RequestID>
</Response>

URL generated is : https://ec2.amazonaws.com/?AWSAccessKeyId=MYKEY&Action=DescribeImageAttribute&Attribute=productCodes&ImageId=ami-823919e7&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2017-08-10T07%3A39%3A47Z&Signature=MY_SIGNATURE

like image 836
Aditya Chauhan Avatar asked Oct 23 '25 18:10

Aditya Chauhan


1 Answers

Your request seems to lack a Version attribute, so the service apparently assumes that you are some very old code that only knows about a very old version of the EC2 API, so it passes the request down to that old request handler, which has no idea what you're asking for, and responds with an error.

You need &Version=2016-11-15 in the query before signing the request, where 2016-11-15 is the current API release version, shown at the top of each page in the API reference manual. The date is different for each AWS service.

This is one way AWS manages to not break things at the API level. Incompatible changes in requests and responses are deployed as a new API version, so old code doesn't fail.

like image 88
Michael - sqlbot Avatar answered Oct 26 '25 12:10

Michael - sqlbot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!