Change: Ensure dotenv.load called before AWS load#369
Merged
DeviaVir merged 1 commit intomotdotla:masterfrom Aug 14, 2017
Merged
Change: Ensure dotenv.load called before AWS load#369DeviaVir merged 1 commit intomotdotla:masterfrom
DeviaVir merged 1 commit intomotdotla:masterfrom
Conversation
DeviaVir
approved these changes
Aug 14, 2017
Collaborator
DeviaVir
left a comment
There was a problem hiding this comment.
fair enough, no reason not to support this 👍
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR simply changes the the place
dotenv.loadis called to a few lines earlier, before requiringaws-sdk. This means the contents of one's.envis loaded intoprocess.envbefore anything in AWS-SDK executes. This resolves an issue we've seen where aws-sdk seems to use globally set AWS creds instead of those in./.env. This seems to be a source of frustration for others. The issue becomes apparent when one attempts to usenode-lambdaas a dev dependency (rather than, as instructed, globally installed) in an app with other aws-sdk dependencies.This new placement of
dotenv.loaddoes not seem to have any effect on tests. Alsodotenvdoes not seem to rely on side-effects of any code executed before it. So I don't see any reasondotenv.loadshould not be called in this new position (apart from this being an odd place to fix an aws-sdk quirk).