Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

reason-bv
Copy link

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