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

AWS credential profiles not found when beats is started by systemd #14157

Closed
jsoriano opened this issue Oct 21, 2019 · 3 comments · Fixed by #14178
Closed

AWS credential profiles not found when beats is started by systemd #14157

jsoriano opened this issue Oct 21, 2019 · 3 comments · Fixed by #14178
Assignees
Labels
docs :Packaging Team:Integrations Label for the Integrations team

Comments

@jsoriano
Copy link
Member

jsoriano commented Oct 21, 2019

When running beats with AWS features, using credential_profile_name setting is pretty helpful to avoid repeating credentials in beats configuration files. These credentials are obtained from the home directory (from ~/.aws/credentials).

When executing from systemd (as done when installed by deb or rpm packages), home directory is not set by default, so this feature cannot be used (at least in an easy way).

To configure the home directory in systemd, the $HOME environment variable has to be explicitly set. Setting a user with User= also sets the $HOME environment variable to the home directory of this user.

This would probably affect any other feature that gets information from this directory.

Some things we could do to improve this:

  • Document that $HOME has to be configured for Beats for this feature to work as expected.
  • Explicitly set a user in included systemd unit files.
@jsoriano jsoriano added docs :Packaging Team:Integrations Label for the Integrations team labels Oct 21, 2019
@kaiyan-sheng
Copy link
Contributor

kaiyan-sheng commented Oct 21, 2019

Thanks @jsoriano for bringing this up. What do you think about adding a new config option for credential_profile_directory and default credential_profile_directory to be ~/.aws/credentials?

@jsoriano
Copy link
Member Author

Thanks @jsoriano for bringing this up. What do you think about adding a new config option for credential_profile_directory and default credential_profile_directory to be ~/.aws/credentials?

If it is possible to define the path where credentials can be found, then I like this solution, yes.

@kaiyan-sheng
Copy link
Contributor

Yes, I looked into the AWS API and found by overwriting AWS_SHARED_CREDENTIALS_FILE environment variable, you can define you own path for the config file. I tried it out and it works: #14178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs :Packaging Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants