Skip to content

Commit

Permalink
migrate sdk to v3 version
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelvilche committed Feb 23, 2023
1 parent 342a574 commit 4ab8ea2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/aws-wrappers.js
@@ -1,31 +1,31 @@
'use strict';

const STS = require('aws-sdk/clients/sts');
const Firehose = require('aws-sdk/clients/firehose');
const { STSClient, AssumeRoleCommand } = require('@aws-sdk/client-sts');
const { FirehoseClient, PutRecordBatchCommand } = require('@aws-sdk/client-firehose');

class FirehoseWrapper {

constructor(config) {
this._firehose = new Firehose(config);
this._firehose = new FirehoseClient(config);
}

/* istanbul ignore next */
// AWS generates the Firehose class on the fly, the putRecordBatch method do not exists before creating the insance
putRecordBatch(records) {
return this._firehose.putRecordBatch(records).promise();
return this._firehose.send(new PutRecordBatchCommand(records));
}
}

class StsWrapper {

constructor(config) {
this._sts = new STS(config);
this._sts = new STSClient(config);
}

/* istanbul ignore next */
// AWS generates the STS class on the fly, the assumeRole method do not exists before creating the insance
assumeRole(params) {
return this._sts.assumeRole(params).promise();
return this._sts.send(new AssumeRoleCommand(params));
}
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -39,10 +39,11 @@
"test": "tests"
},
"dependencies": {
"@aws-sdk/client-firehose": "^3.278.0",
"@aws-sdk/client-sts": "^3.278.0",
"@janiscommerce/api-session": "^3.3.1",
"@janiscommerce/settings": "^1.0.1",
"@janiscommerce/superstruct": "^1.2.0",
"aws-sdk": "^2.498.0",
"axios": "^0.27.2",
"lllog": "^1.1.2",
"uuid": "7.0.3"
Expand Down

0 comments on commit 4ab8ea2

Please sign in to comment.