Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Maks3w authored Jul 16, 2018
1 parent 2c4374c commit 0be30a9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,13 @@ if (!PROFILE) {
else credentials = resolved;
});
} else {
credentials = new AWS.SharedIniFileCredentials({profile: PROFILE});
AWS.config.credentials = credentials;
var loadAwsCredentialsFile = function() {
credentials = new AWS.SharedIniFileCredentials({profile: PROFILE});
AWS.config.credentials = credentials;
};

loadAwsCredentialsFile();
fs.watch(`${homedir}/.aws/credentials`, loadAwsCredentialsFile);
}

function getCredentials(req, res, next) {
Expand Down Expand Up @@ -207,8 +212,3 @@ console.log('Kibana available at http://' + BIND_ADDRESS + ':' + PORT + '/_plugi
if (argv.H) {
console.log('Health endpoint enabled at http://' + BIND_ADDRESS + ':' + PORT + argv.H);
}

fs.watch(`${homedir}/.aws/credentials`, (eventType, filename) => {
credentials = new AWS.SharedIniFileCredentials({profile: PROFILE});
AWS.config.credentials = credentials;
});

0 comments on commit 0be30a9

Please sign in to comment.