This repository was archived by the owner on Feb 11, 2022. It is now read-only.
Add support for credentials file (WIP) #337
Open
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 is adding support for new config option
credential_fileas discussed earlier in #151 and #15 (comment)I tried to implement it exactly the way @mitchellh described in #15 (comment) and it basically works except that I probably don't fully understand the lifecycle - when
finalize!&validategets called, which is why the validation is broken and always assumes conflict.Maybe I can move the whole block in
finalizesomewhere else, so it gets executed aftervalidate?Also there's one more config option that can be added,
profiledefaulting toENV['AWS_PROFILE']:https://github.com/aws/aws-sdk-ruby/blob/master/spec/aws/core/credential_providers_spec.rb#L395
Here's an example of
AWS_PROFILEvariable name use (just FYI, that I'm not reinventing the wheel here):https://github.com/aws/aws-sdk-core-ruby/blob/90f34bcb002ef8be418502164063fe297727f9d5/aws-sdk-core/lib/aws-sdk-core/shared_credentials.rb#L13-14
Here's an example of how the generated ini file may look like:
https://github.com/aws/aws-cli/blob/master/README.rst#getting-started