I need to create script using boto3 which should make sending email notifications from AWS CloudWatch whenever instance in cluster is unhealthy.
I'm following put_metric_alarm()
documentation to create boto3 script, and I found that to achieve my requirement I can use MRUnhealthyNodes
metric type. I've written a small script to create alarm which should work:
client.put_metric_alarm (
AlarmName='name',
AlarmDescription='alarm description',
AlarmActions=[
'sns:arn',
],
MetricName='MRUnhealthyNodes',
Namespace='AWS/ElasticMapReduce',
Statistic='Minimum',
Dimensions=[
{
'Name': 'string',
'Value': 'string'
},
],
Period=300,
EvaluationPeriods=287,
Threshold=1,
ComparisonOperator='GreaterThanOrEqualToThreshold'
)
Here, I'm little confused what should be the value for:
Dimensions=[
{
'Name': 'string',
'Value': 'string'
},
]
I am new in the AWS world, so can someone help me with this? Thank you in advance!