How to get EC2 instance tags when pulling CloudWatch data? For monitoring purposes, we're pulling AWS/EC2 instances statistics data from CloudWatch and save it to InfluxDB. 

We're using Telegraf to do this. 

However, when pulling the data from Cloudwatch, it doesn't contain the instance tags or env_variables, only the standard instance fields (instance_id, for example) 

Is there a way to get this data when pulling the stats? Some other agent? A Lambda function?
CloudWatch metrics contain "dimensions" that loosely match InfluxDB's concept of "tags". The list of dimensions available for EC2 metrics is available in the AWS documentation. Instances tags are not available and I'm not sure what you mean by env_variables but since all that is supported is


AutoScalingGroupName
ImageId
InstanceId
InstanceType


the answer is still going to be this is not possible.