Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix issues with incorrect variable assignment of key, secret, and token obtained from Instance Metadata.#84

Open
reason-bv wants to merge 1 commit into
mirkokiefer:masterfrom
reason-bv:fix-instance-metadata-issue
Open

Fix issues with incorrect variable assignment of key, secret, and token obtained from Instance Metadata.#84
reason-bv wants to merge 1 commit into
mirkokiefer:masterfrom
reason-bv:fix-instance-metadata-issue

Conversation

@reason-bv
Copy link
Copy Markdown

See issue https://github.com/livelycode/aws-lib/issues/83 .

When running in AWS with an instance role, setting accessKeyId and secretAccessKey to null does not result in the key, secret, and token being read correctly from the Instance Metadata service.

Or rather these values are being obtained, but they are being assigned to the variables that are then not referenced.

Here in lib/aws.js you are setting securityToken, accessKeyId, and secretAccessKey prior to the values in obj being reset with the values obtained from Instance Metadata.

  var securityToken = obj.token;
  var signHeader = obj.signHeader;
  var host = obj.host;
  var accessKeyId = obj.accessKeyId;
  var path = obj.path;
  var agent = obj.agent;
  var secretAccessKey = obj.secretAccessKey;
  var secure = obj.secure == null ? true : false;
  var connection = secure ? https : http;

Then when you reference the scope variables later they are still null even though you have updated obj.

This pull request updates lib/aws.js to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant