Knowledge Center Monthly Newsletter - March 2025
Stay up to date with the latest from the Knowledge Center. See all new and updated Knowledge Center articles published in the last month and re:Post’s top contributors.
はじめまして。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を使うことで回避しました。
ログインしていません。 ログイン 回答を投稿する。
優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。