From d9fdf0ae5b2c45e97ce9875c007d54ac1ac07209 Mon Sep 17 00:00:00 2001 From: yzpaul Date: Tue, 21 Jun 2022 21:39:46 -0400 Subject: [PATCH 1/3] update CloudwatchLogs credential object allows user provided credentials to work. Prior version was not nested correctly therefore AWS SDK ignored it --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 2e5c3c6..6dbd0bb 100644 --- a/index.js +++ b/index.js @@ -49,7 +49,7 @@ var WinstonCloudWatch = function(options) { config = assign(config, options.awsOptions); } - this.cloudwatchlogs = new CloudWatchLogs(config); + this.cloudwatchlogs = new CloudWatchLogs({credentials:config}); } debug('constructor finished'); From 7995fe40a33cd760e58c3c240e958ffe002a0b3e Mon Sep 17 00:00:00 2001 From: yzpaul Date: Wed, 29 Jun 2022 18:56:59 -0400 Subject: [PATCH 2/3] region at the same level as credentials --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 6dbd0bb..519d983 100644 --- a/index.js +++ b/index.js @@ -37,7 +37,7 @@ var WinstonCloudWatch = function(options) { var config = {}; if (awsAccessKeyId && awsSecretKey && awsRegion) { - config = { accessKeyId: awsAccessKeyId, secretAccessKey: awsSecretKey, region: awsRegion }; + config = {credentials: {accessKeyId: awsAccessKeyId, secretAccessKey: awsSecretKey}, region: awsRegion}; } else if (awsRegion && !awsAccessKeyId && !awsSecretKey) { // Amazon SDK will automatically pull access credentials // from IAM Role when running on EC2 but region still From aa68f7fbb207a437354ab9a1d70e777727113d1a Mon Sep 17 00:00:00 2001 From: yzpaul Date: Wed, 29 Jun 2022 18:58:19 -0400 Subject: [PATCH 3/3] reworked so region stayed at top level --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 519d983..d695c64 100644 --- a/index.js +++ b/index.js @@ -49,7 +49,7 @@ var WinstonCloudWatch = function(options) { config = assign(config, options.awsOptions); } - this.cloudwatchlogs = new CloudWatchLogs({credentials:config}); + this.cloudwatchlogs = new CloudWatchLogs(config); } debug('constructor finished');