0
AWSにアプリケーションをデプロイするときに、aws-sdkのパフォーマンスに重大な問題があります。 私は以下のようにそれを使用しています:aws-sdk DocumentClientコンストラクタでhttpOptionsを渡すには?
wrapper = {
accessKeyId: "YOURACCESSKEY",
secretAccessKey: "YOURSECRETKEY",
region: "us-east-1",
endpoint: new AWS.Endpoint('http://localhost:8000')
};
AWS.config.update(wrapper);
const docClient = new AWS.DynamoDB.DocumentClient();
module.exports ={"docClient":docClient};
私が研究し、ことが判明 - https://github.com/aws/aws-sdk-js/issues/900 - キープアライブが有効になっているように、我々は、AWSでhttpOptionsを指定することができます。
私の質問はどのように私は上記AWS-SDKのコンストラクタでhttpOptionsを指定してください、次のとおりです。
var dynamo = new AWS.DynamoDB({
region: "ap-southeast-2",
httpOptions: {
agent: new https.Agent({
rejectUnauthorized: true,
keepAlive: true
})
}
});
これをラッパー設定に追加する方法。それはこのようなものでなければなりませんAWS.config.update
AWS.config.update({httpOptions:{}}、true) 'を試しましたか? 'true'は余分なキーを許可しています... – Malice