ファイルは.js
スクリプトに保存され、AWS S3に保存されています。エラー:要求に含まれるセキュリティトークンが無効です - AWS DynamoDB
AWS.config.update({
region: "us-west-2",
//endpoint: 'dynamodb.us-west-2.amazonaws.com',
accessKeyId: "name",
secretAccessKey: "pass"
});
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
var params = {
TableName : "table_name",
ProjectionExpression:"company, link, budget",
KeyConditionExpression: "company = :Adidas"
};
dynamodb.query(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
私はDynamoDBのからデータを取得しようとしていますが、代わりにこれを取得
:
Error: The security token included in the request is invalid. at Request.extractError (aws-sdk.js:96980) at Request.callListeners (aws-sdk.js:98762) at Request.emit (aws-sdk.js:98736) at Request.emit (aws-sdk.js:97899) at Request.transition (aws-sdk.js:97626) at AcceptorStateMachine.runTo (aws-sdk.js:101148) at aws-sdk.js:101160 at Request. (aws-sdk.js:97642) at Request. (aws-sdk.js:97901) at Request.callListeners (aws-sdk.js:98772) "UnrecognizedClientException: The security token included in the request is invalid. at Request.extractError (https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.22.0/aws-sdk.js:96980:27) at Request.callListeners (https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.22.0/aws-sdk.js:98762:20) at Request.emit (https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.22.0/aws-sdk.js:98736:10) at Request.emit (https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.22.0/aws-sdk.js:97899:14) at Request.transition (https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.22.0/aws-sdk.js:97626:10) at AcceptorStateMachine.runTo (https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.22.0/aws-sdk.js:101148:12) at https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.22.0/aws-sdk.js:101160:10 at Request. (https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.22.0/aws-sdk.js:97642:9) at Request. (https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.22.0/aws-sdk.js:97901:12) at Request.callListeners (https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.22.0/aws-sdk.js:98772:18)"
がどのように私はこの作業を行うことができますか?
うーん... "名前" と "パス" を共有しましたか?あなたのaccessKeyIdは 'AKIA'または' ASIA'で始まりますか?そうでない場合は、ここで使用しているaccessKeyIdではありません。 –
uso-west-2領域にDynamoDBテーブルがあることを確認しますか?地域は非常に重要なパラメータです。 – notionquest