0

I need to send logs to cloudwatch using fluentbit, from the application hosted on my local system, but i am unable to configure the aws credentials for fluent bit to send logs to cloudwatch. It will be of great help if anyone can help me with the same. Some of the logs are as follows:-

[aws_credentials] Initialized Env Provider in standard chain
[aws_credentials] Failed to initialized profile provider: $HOME not set and AWS_SHARED_CREDENTIALS_FILE not set.
[aws_credentials] Not initializing EKS provider because AWS_ROLE_ARN was not set
[aws_credentials] Initialized EC2 Provider in standard chain
[aws_credentials] Not initializing ECS Provider because AWS_CONTAINER_CREDENTIALS_RELATIVE_URI is not set
[aws_credentials] Sync called on the EC2 provider
[aws_credentials] Init called on the env provider
[aws_credentials] Init called on the EC2 IMDS provider
[aws_credentials] requesting credentials from EC2 IMDS
Raghu kapur
  • 9
  • 1
  • 2

3 Answers3

0

Any standard way to pass credentials should work here:

  • export environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  • or create ~/.aws/credentials, may use aws configure prompt for this.
Max Lobur
  • 5,662
  • 22
  • 35
0

During my testing the variable weren't enough same for the credentials file. I installed AWS cli configure it with the keys and now it works as expected. I am working with containers and the AWS cli add extra size that I don't need so if anyone knows a way to do it without it. that would be awesome.

Chop Labalagun
  • 592
  • 1
  • 6
  • 19
0

I ran into this same problem on my server when running the fluent-bit service. Installing the AWS CLI and setting the config and credentials in ~/.aws/config and ~/.aws/credentials still wasn't enough.

My solution was to follow this Stackoverflow post, and create a service override.conf file for the fluent-bit service where the ENV variables for HOME, AWS_CONFIG_FILE, and AWS_SHARED_CREDENTIALS_FILE are all explicitly defined.

The override.conf file looked like this:

[Service]
Environment="HOME=/root"
Environment="AWS_CONFIG_FILE=/root/.aws/config"
Environment="AWS_SHARED_CREDENTIALS_FILE=/root/.aws/credentials"

After setting that and restarting the fluent-bit service, fluent-bit successfully sent logs to AWS CloudWatch, and I stopped getting the Failed to initialized profile provider error.