The exporter needs permissions to access the resources from the AWS account.
First, create an AWS IAM policy on your AWS infrastructure. The policy should allow the account to read CloudWatch metrics and get resources by tags. An example AWS IAM configuration is given below:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "CloudWatchExporterPolicy",
"Effect": "Allow",
"Action": [
"tag:GetResources",
"cloudwatch:ListTagsForResource",
"cloudwatch:GetMetricStatistics",
"cloudwatch:GetMetricData",
"cloudwatch:ListMetrics"
],
"Resource": "*"
}
]
}
Create a $HOME/.aws/credentials
file as follows. Substitute the values with your key and password:
# CREDENTIALS FOR AWS ACCOUNT
aws_region = us-east-1
aws_access_key_id = AYYYYYZZZZZZ3BLXXXXX
aws_secret_access_key = bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The YACE exporter uses an API call that filters the resources by tags. Therefore, if you want to monitor a resource, ensure that it has at least one tag associated with it. A resource without a tag will not be scraped.
To install the exporter follow this steps:
- Download the
lambda-deploy.yaml
file. - Change the following line in the ConfigMap with the AWS region where the resources to monitor are located:
region: us-east-1
- Run following command and copy the content:
cat ~/.aws/credentials | base64
- Replace the content of the
credentials
field of the secretyace-lambda-credentials
with the one that you have copied. - Apply the deployment:
kubectl apply -f lambda-deploy.yaml
- Ensure that the exporter is working checking that the pods are running:
kubectl -n yace get pods