Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon cloudwatch agent not working

I'm trying to add aws cloudwatch agent to see additional metrics using tutorial

A brief review of what I did:

  1. Create AIM role and attach to EC2 instance doc (NOTE: I do not use Parameter Store just for communication between EC2 and cloudwatch)
  2. Install Agent using s3 link
  3. Create agent configuration file docs
  4. Run agent using CLI dosc

But it still not working and in agent log, I see errors like

ec2tagger: Unable to initialize EC2 Instance Tags : +NoCredentialProviders: no valid providers in chain. Deprecated. For verbose messaging see aws.Config.CredentialsChainVerboseErrors

While googling I found not much related to cloudwath just only that in AIM role in 'Trust Relationship' config ec2 should be mentioned in service section and it is:

    {
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Service": "ec2.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

Any ideas, thanks!?

like image 538
Bogdan Dubyk Avatar asked Feb 01 '18 09:02

Bogdan Dubyk


1 Answers

In my case the instance had an IAM role attached, but the role was missing the ec2:DescribeTags permission. Adding that fixed the problem.

like image 154
dskrvk Avatar answered Oct 22 '22 21:10

dskrvk