sematext / logagent-js

Extensible log shipper with input/output plugins, buffering, parsing, data masking, and small memory/CPU footprint
https://sematext.com/logagent
Apache License 2.0
389 stars 79 forks source link

logagent to load credentials from EC2 role instead of aws_config.json #286

Open aliartiza75 opened 3 years ago

aliartiza75 commented 3 years ago

Hi @adnanrahic,

Scenario

I am using an EC2 instance and running a node application on it using pm2. I want to forward the logs to AWS Elasticsearch.

Problem

I have already read the documentation and found out that it uses a config file to load credentials but in my scenario, I cannot use a config file like this due to some security protocols.

Currently, I assign a role to the AWS EC2 instance and the application on the server uses those role credentials.

Possible Solution

A possible solution could be if we specify some precedence in the configuration like AWS does is doing.

Is there any other channel where I can discuss this issue?

Thank you in advance

otisg commented 3 years ago

This is a good place to discuss. Maybe you can submit a PR?

aliartiza75 commented 3 years ago

@otisg yes sure.

aliartiza75 commented 3 years ago

Hi @megastef,

I need some help regarding the AWS elasticsearch output plugin implementation. After reading the codebase I found out that you have imported the aws-sdk but didn't use(maybe i am wrong) it.

Will it be able to load credentials from the role attached to EC2 instance?

aliartiza75 commented 2 years ago

@otisg I have created a PR for this change. Please get someone to review it. As I am not a JS dev I have tried my best.

https://github.com/sematext/logagent-js/pull/288

otisg commented 2 years ago

Thanks, merged.