I configured metricbeat to test collection info from my AWS account and the logs show me this error:
Aug 28 16:59:22 heartbeat metricbeat[74048]: {"log.level":"info","@timestamp":"2023-08-28T16:59:22.269Z","log.logger":"cloudwatch","log.origin":{"file.name":"cloudwatch/cloudwatch.go","file.line":516},"message":"getResourcesTags failed, skipping region us-east-1: error GetResources with Paginator: operation error Resource Groups Tagging API: GetResources, https response error StatusCode: 0, RequestID: , canceled, context deadline exceeded","service.name":"metricbeat","ecs.version":"1.6.0"}
AWS module configuration:
#Module: aws
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/main/metricbeat-module-aws.html
- module: aws
period: 1m
metricsets:
- elb
- kinesis
- natgateway
- rds
- transitgateway
- usage
- vpn
#- module: aws
# period: 5m
# metricsets:
# - cloudwatch
# metrics:
# - namespace: AWS/EC2
# - namespace: AWS/Billing
# - namespace: AWS/Lambda
# - namespace: AWS/S3
# - namespace: AWS/Route53
# - namespace: AWS/RDS
# - namespace: AWS/EBS
# - namespace: AWS/ApplicationELB
# - namespace: AWS/NetworkELB
- module: aws
period: 5m
metricsets:
- dynamodb
- ebs
- ec2
- lambda
- rds
- sns
- sqs
- module: aws
period: 24h
metricsets:
- billing
cost_explorer_config:
group_by_dimension_keys:
- "AZ"
- "INSTANCE_TYPE"
- "SERVICE"
# - "LINKED_ACCOUNT"
# group_by_tag_keys:
# - "aws:createdBy"
- module: aws
period: 24h
metricsets:
- s3_daily_storage
- module: aws
period: 1m
latency: 5m
include_linked_accounts: false
metricsets:
- s3_request
The IAM policy is as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"tag:GetResources",
"ec2:DescribeInstances",
"ec2:RequestSpotInstances",
"cloudwatch:GetMetricData",
"tag:GetTagValues",
"ec2:DescribeInstanceAttribute",
"ec2:DescribeRegions",
"ce:GetCostAndUsage",
"tag:DescribeReportCreation",
"ec2:DescribeSpotInstanceRequests",
"tag:GetTagKeys",
"cloudwatch:ListMetrics",
"ec2:GetConsoleOutput",
"iam:ListInstanceProfilesForRole",
"iam:PassRole",
"ec2:StartInstances",
"ec2:DescribeAvailabilityZones",
"rds:DescribeDBInstances",
"ec2:DescribeKeyPairs",
"sqs:ListQueues",
"ec2:TerminateInstances",
"ec2:DescribeTags",
"ec2:RunInstances",
"ec2:DescribeInstanceEventNotificationAttributes",
"ec2:StopInstances",
"ec2:DescribeSecurityGroups",
"tag:GetComplianceSummary",
"ec2:DescribeImages",
"ec2:CancelSpotInstanceRequests",
"organizations:ListAccounts",
"ec2:GetPasswordData",
"ec2:DescribeInstanceTypes",
"iam:ListAccountAliases",
"sts:GetCallerIdentity",
"ec2:DescribeSubnets"
],
"Resource": "*"
}
]
}
Not sure what am I doing wrong