はじめまして。showkkoと申します。 EC2のRest APIを使用しようとして、ちょっと困ったことになっています。
他のAPI Action("DescribeTags", "CreateImage", "CreateKeyPair"等々)ではうまく応答が取れるのに、 "CreateTags"を用いたときには"SignatureDoesNotMatch"になってしまいます。 https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html
sig_data="POST\nec2.ap-northeast-1.amazonaws.com\n/\nAWSAccessKeyId="accessid"&Action=CreateTags&ResourceId.1="resourceid"&Tag.1.Key="tagname"&Tag.1.Value="tagvalue"&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp="timestr"&Version=2016-11-15"
sig_seed=hmac.new(secretkey.encode("utf-8"),sig_data.encode("utf-8"),hashlib.sha256)
"DescribeTags"ではうまくいっているので、タグ特有という訳ではないとは思いますが、どなたか理由はわかりますでしょうか?
生でAPIを呼ぶのをやめ、SDKを使うことで回避しました。
You are not logged in. Log in to post an answer.
A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.