-
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 GetAWSCredentials function in libbeat common #12727
Add GetAWSCredentials function in libbeat common #12727
Conversation
@kvch @andrewvc This PR created a common function to get AWS credentials in x-pack/libbeat. Will this be useful to functionbeat? I see we can probably use this at https://github.com/elastic/beats/pull/12401/files#diff-d30e2477c79a898c9f035f2980beb071R55 in @andrewvc's PR for adding auto discover provider for AWS ELB. |
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.
The changes I've suggested should get your docs building locally. Just reach out to me if you have more issues. After you have the structure like you want it, we'll need to update the sources
section in the conf.yaml so the full doc build can find the new libbeat directory under x-pack. See https://github.com/elastic/docs/blob/master/conf.yaml#L731.
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.
jenkins, test this please |
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.
Code LGTM, good stuff! Left some minor corrections for the docs/copy.
Looking forward to using this in #9043 .
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.
LGTM
CI failure is not related: #13009 |
This PR broke docs CI. When merging this PR into 7.x, https://github.com/elastic/docs/blob/master/conf.yaml#L745 needs to be changed again, 7.x needs to be removed from the list of excluded branches. |
Done updating the description with how to test this. Thanks for adding the label @andresrc ! |
This PR creates a function in libbeat common to get aws credentials. If
access_key_id
andsecret_access_key
are given, then these will be used as aws credentials to make API calls. If they are not given, then this function will load default aws config instead from~/.aws/credentials
for Linux & Mac or%USERPROFILE%\.aws\credentials
for Windows. This PR also introduced a new config parametercredential_profile_name
. It givesGetAWSCredentials
function the ability to load aws config from a specific profile. Please see https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html for more details.This function is from #12701 and I realized both metricbeat and filebeat will need this. That's why I'm moving this method to libbeat common. Also functionbeat will be able to use it.
closes: #12708
How to test it
In order to test GetAWSCredentials, you can use aws Metricbeat module or aws Filebeat module:
credential_profile_name
:~/.aws/credentials
under~/.aws/credentials
file.default
. If it's under default, thencredential_profile_name: default
is not needed.