CloudWatch SMS notifications for EC2 instances that are not in us-east-1

I'm looking to set up a notification scheme for my EC2 instances that are in the us-west-2 data center. I have read the CloudWatch and SNS documents, and I know that SMS notifications are only available when configuring SNS themes in us-east-1.

I am wondering if anyone found a way to get CloudWatch warnings for NOT instances in us-east-1 to broadcast on setting up a theme in us-east-1?

+4
source share
4 answers

, - us-west-2, us-east-1 SMS, ( 10 2014 ):

A client error (ValidationError) occurred when calling the PutMetricAlarm operation: Invalid region us-east-1 specified. Only us-west-2 is supported.

aws cli ( 1234567890):

aws cloudwatch put-metric-alarm --alarm-name "ELB UnHealthy > 0" --alarm-description "ELB UnHealthy > 0" --actions-enabled --ok-actions arn:aws:sns:us-west-2:1234567890:EmailOnly --alarm-actions arn:aws:sns:us-east-1:1234567890:EmailAndSMS --insufficient-data-actions arn:aws:sns:us-west-2:1234567890:EmailOnly --metric-name UnHealthyHostCount --namespace AWS/ELB --statistic Average --dimensions Name=LoadBalancerName,Value=elb-name --period 60 --evaluation-periods 3 --threshold 1 --comparison-operator GreaterThanOrEqualToThreshold

, -, ... , AWS ...

+6

CLI Amazon Cloudwatch. us-west-2, mon-put-metric-alarm ARN us-east-1 alarm-actions.

export AWS_CLOUDWATCH_URL=http://monitoring.us-west-2.amazonaws.com/

mon-put-metric-alarm --alarm-name my-alarm --alarm-description "some desc"
    --metric-name CPUUtilization --namespace AWS/EC2 
    --statistic Average  --period 60 --threshold 90 
    --comparison-operator GreaterThanThreshold  
    --dimensions InstanceId=i-abcdef --evaluation-periods 3  --unit Percent 
    --alarm-actions arn:aws:sns:us-east-1:1234567890:my-topic

:
http://docs.aws.amazon.com/AmazonCloudWatch/latest/cli/cli-mon-put-metric-alarm.html

CLI : http://docs.aws.amazon.com/AmazonCloudWatch/latest/cli/SetupCLI.html

+1

, , us-west-1, SMS-, . , us-east-1.

us-west-1 us-east-1 .

aws cloudwatch put-metric-data 
    --region us-east-1 --namespace NameSpace --metric-name MetricName 
    --dimensions InstanceId=i-12345678 --value 10

, us-east-1, SNS SMS-.

, us-east-1 , , . , SNS, .

SMS- SNS .

, us-west-1 us-east-1, , , , .

+1

If you are trying to create alarms in a region other than your default, you must explicitly specify it with the --region parameter (even though this is already implied in ARN).

0
source

Source: https://habr.com/ru/post/1542526/


All Articles