swap709
swap709

Reputation: 173

Cloudformation for URLHealthcheck with SNS Alarm

I'm trying to define a Route53 URL Healthcheck with an alarm referring to an existing SNS Topic.

I'm unable to find how to define this Alarm within the Route53 URL Health Check CF template:

My Cloudformation URLHealthCheck template:

 ASDDURLHealthCheck: 
    Type: "AWS::Route53::HealthCheck"
    Properties: 
      HealthCheckConfig:
        FullyQualifiedDomainName: "newserver.aws.lilly.com"
        Port: "8888"
        Type: "HTTPS"
        ResourcePath: "/new"
        RequestInterval: "30"
        FailureThreshold: "3"

I want to add SNS Alarm to the above in the following way:

    AlarmActions: 
        -   "arn:aws:sns:us-east-2:xxxxxxx:MySNSTopic"

Upvotes: 0

Views: 520

Answers (1)

Sudharsan Sivasankaran
Sudharsan Sivasankaran

Reputation: 5887

You need to create "AWS::CloudWatch::Alarm" resource.

HealthCheckStatusAlarm:
  Type: AWS::CloudWatch::Alarm
  Properties:
    AlarmDescription: HealthCheckStatus
    AlarmActions:
    - arn:aws:sns:us-east-2:xxxxxxx:MySNSTopic
    MetricName: HealthCheckStatus
    Namespace: AWS/Route53
    Statistic: Minimum
    Period: '60'
    EvaluationPeriods: '3'
    Threshold: '1'
    ComparisonOperator: GreaterThanThreshold
    Dimensions:
    - Name: HealthCheckId
      Value:
        Ref: ASDDURLHealthCheck

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-cloudwatch.html#cloudwatch-sample-cpu-utilization-alarm

Upvotes: 1

Related Questions