Wrapping everything up in CloudFormation
We can easily create the same endpoint using a CloudFormation template. Let's just add this block to the CloudFormation template's Resources
section:
"TestEndpointHealthCheck": { "Type": "AWS::Route53::HealthCheck", "Properties": { "HealthCheckConfig": { "Port": "443", "Type": "HTTPS", "ResourcePath": "/test", "FullyQualifiedDomainName": { "Ref": "DomainName" }, "RequestInterval": "30", "FailureThreshold": "3", "MeasureLatency": "true", "EnableSNI": "true" }, "HealthCheckTags": [ { "Key": "Name", "Value": "TestEndpoint" } ] } }
This configuration will only create the health check, but it will not create the alarm. To have the same configuration we've just had with the UI, we need to create first an SNS topic, its subscriptions, and finally, the alarm.
Here we have the topic definition with only email subscription:
"HealthChecksSnsTopic...