fluent-plugins-nursery / fluent-plugin-cloudwatch-logs

CloudWatch Logs Plugin for Fluentd
MIT License
201 stars 141 forks source link

add aws ecs authentication #240

Closed github-gael-soude closed 2 years ago

github-gael-soude commented 2 years ago

Hello I'm a total noob with Github and Dev in general. I hope I did the PR in the right way...

I wanted to be able to use this plugin from AWS ECS containers running Fluentd. In order to get valid credentials within ECS containers it is needed to query AWS_CONTAINER_CREDENTIALS_RELATIVE_URI env variable. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html

I added the feature inspired from another plugin here: https://github.com/atomita/fluent-plugin-aws-elasticsearch-service/blob/master/lib/fluent/plugin/out_aws-elasticsearch-service.rb

Don't hesitate to contact me.

github-gael-soude commented 2 years ago

FYI

I tested it on a ECS instance in my company and this seems to work like it should

cosmo0920 commented 2 years ago

I'm a total noob with Github and Dev in general. I hope I did the PR in the right way...

This is right way on fluent-plugin-nursery org repositories. For fluent org, we must use Signed-off-by line with git commit -s.