amazon ec2 - How to invoke RunInstances action on ec2.amazonaws.com using shell script? -


every time getting error:

the request signature calculated not match signature provided. check aws secret access key , signing method. consult service documentation details.

this script:

#!/bin/bash  dt=$(date +%ft%tz | sed 's/:/%3a/g') echo "$dt"  q="get elasticmapreduce.amazonaws.com / awsaccesskeyid=652387uyt56182&action=describejobflows&signaturemethod=hmacsha256&signatureversion=2&timestamp=$dt&version=2009-03-31"  sig=$(echo -n "$q" | openssl dgst -sha256 -hmac q65272/ui5878/t62989231232 - binary| openssl enc -base64)  echo "the signature without url encoding $sig"   curl --get --url  "https://ec2.amazonaws.com/?action=startinstances&awsaccesskeyid=ty76476587yt4756&instanceid.1=t-76wergf&maxcount=1&mincount=1&signaturemethod=hmacsha256&signatureversion=2&timestamp=$dt&signature=$sig&version=2012-07-20" 

can tell me wrong in code? have altered secret credentials confidentiality. thanks.


Comments