2014-09-03 37 views
3

我無法獲得簡單的AWS Node.js EC2示例。這裏是我的代碼:簽名與使用Node.js SDK的AWS不匹配

{ [SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.] 
    message: 'The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.', 
    code: 'SignatureDoesNotMatch', 
    time: Wed Sep 03 2014 16:29:37 GMT-0700 (PDT), 
    statusCode: 403, 
    retryable: false } 

爲什麼會出現這個錯誤,我該如何解決這個問題:

var AWS = require('aws-sdk'); 
AWS.config.loadFromPath('./config.json'); 
new AWS.EC2().describeInstances(function(err, data) { 
    if (err) { 
     console.log(err); 
    } else { 
     console.log(data); 
    } 
}); 

運行時,它看起來像這樣我得到的錯誤?

我在Ubuntu 14.04.1 LTS 64位桌面上使用Node.js v0.10.31。

下載完整示例herehere

crossposted這裏:https://forums.aws.amazon.com/thread.jspa?threadID=160122

回答

0

sudo pip install awscli固定的問題。

aws --version現在返回aws-cli/1.7.14 Python/2.7.6 Linux/3.13.0-49-generic

相關問題