-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add AWS_SHARED_CREDENTIALS_FILE to get aws config #14178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking at this, this will be very helpful in some scenarios!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this feature! There is a small extra suggestion, but it LGTM.
* Add AWS_SHARED_CREDENTIALS_FILE to get aws config
…get aws config (elastic#14228) * Add AWS_SHARED_CREDENTIALS_FILE to get aws config (elastic#14178) (cherry picked from commit 133aeb1) * Update changelog
shared_credential_file
can be set for the path to the shared credentials file. If empty/not set, it will be default to current user's home directory. For Linux/OSX is$HOME/.aws/credentials
and for Windows is%USERPROFILE%\.aws\credentials
.closes #14157
How to test this:
Copy your aws credential to some other directory or change the name. I change mine to credentials-backup instead.
case1
Enable aws module in Metricbeat and change aws.yml to:
You should see EC2 metrics flowing into ES with no credential error.
case2
Either with specified
credential_profile_name
but noshared_credential_file
or specifiedshared_credential_file
but nocredential_profile_name
should work.Set valid credentials under
[test-mb]
profile in default credential file~/.aws/credentials
and test with config below:case3
Set valid credentials under
[default]
profile in credential file~/.aws/credentials-backup
and test with config below:case4
Set valid credentials under
[default]
profile in default credential file~/.aws/credentials
and test with config below without credential_profile_name or shared_credential_file: