Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix to set region at client creation
Currently, a region is set to the aws instance to be used in common.
Since it may not be as expected as it is in parallel processing, it is
set when each client is created.
  • Loading branch information
abetomo committed Aug 2, 2018
commit d50f32e5bedcfd83e7532aae0a704bf56d85c727
3 changes: 2 additions & 1 deletion lib/cloudwatch_logs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use strict'

class CloudWatchLogs {
constructor (aws) {
constructor (aws, region) {
// Authenticated `aws` object in `lib/main.js`
this.lambda = new aws.Lambda({
region: region,
apiVersion: '2015-03-31'
})
this.cloudwatchlogs = new aws.CloudWatchLogs({
Expand Down
11 changes: 7 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,10 +845,13 @@ they may not work as expected in the Lambda environment.
console.log(params)

this._awsConfigUpdate(program, region)
const lambda = new aws.Lambda({ apiVersion: '2015-03-31' })
const scheduleEvents = new ScheduleEvents(aws)
const s3Events = new S3Events(aws)
const cloudWatchLogs = new CloudWatchLogs(aws)
const lambda = new aws.Lambda({
region: region,
apiVersion: '2015-03-31'
})
const scheduleEvents = new ScheduleEvents(aws, region)
const s3Events = new S3Events(aws, region)
const cloudWatchLogs = new CloudWatchLogs(aws, region)

// Checking function
return lambda.getFunction({
Expand Down
4 changes: 3 additions & 1 deletion lib/s3_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
* Put the Notification Configuration in the existing Bucket.
*/
class S3Events {
constructor (aws) {
constructor (aws, region) {
// Authenticated `aws` object in `lib/main.js`
this.lambda = new aws.Lambda({
region: region,
apiVersion: '2015-03-31'
})
this.s3 = new aws.S3({
region: region,
apiVersion: '2006-03-01'
})
}
Expand Down
3 changes: 2 additions & 1 deletion lib/schedule_events.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use strict'

class ScheduleEvents {
constructor (aws) {
constructor (aws, region) {
// Authenticated `aws` object in `lib/main.js`
this.lambda = new aws.Lambda({
region: region,
apiVersion: '2015-03-31'
})
this.cloudwatchevents = new aws.CloudWatchEvents({
Expand Down