AWS Route 53 Health Check
This page shows how to write Terraform and CloudFormation for Route 53 Health Check and write them securely.
aws_route53_health_check (Terraform)
The Health Check in Route 53 can be configured in Terraform with the resource name aws_route53_health_check
. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_route53_health_check" "secure_website" {
fqdn = "example.com"
port = 443
type = "HTTPS"
resource_path = "/"
failure_threshold = "5"
resource "aws_route53_health_check" "www_alias_record_nat_servers_useast1a_health_check" {
failure_threshold = "3"
fqdn = aws_route53_record.www_alias_record_nat_servers_useast1a.fqdn
port = 443
request_interval = "10"
resource_path = "/"
resource "aws_route53_health_check" "east" {
failure_threshold = "3"
fqdn = var.east_domain
port = 443
request_interval = "30"
resource_path = "/"
resource "aws_route53_health_check" "simple" {
failure_threshold = "5"
fqdn = "example.com"
port = 80
request_interval = "30"
resource_path = "/"
Parameters
-
child_health_threshold
optional - number -
child_healthchecks
optional - set of string -
cloudwatch_alarm_name
optional - string -
cloudwatch_alarm_region
optional - string -
disabled
optional - bool -
enable_sni
optional computed - bool -
failure_threshold
optional - number -
fqdn
optional - string -
id
optional computed - string -
insufficient_data_health_status
optional - string -
invert_healthcheck
optional - bool -
ip_address
optional - string -
measure_latency
optional - bool -
port
optional - number -
reference_name
optional - string -
regions
optional - set of string -
request_interval
optional - number -
resource_path
optional - string -
search_string
optional - string -
tags
optional - map from string to string -
type
required - string
Explanation in Terraform Registry
Provides a Route53 health check.
AWS::Route53::HealthCheck (CloudFormation)
The HealthCheck in Route53 can be configured in CloudFormation with the resource name AWS::Route53::HealthCheck
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: "AWS::Route53::HealthCheck"
DependsOn: ApplicationLoadBalancer1
Properties:
HealthCheckConfig:
Type: "HTTP"
FullyQualifiedDomainName:
Type: AWS::Route53::HealthCheck
DependsOn: RoutingControlCell1
Properties:
HealthCheckConfig:
Type: RECOVERY_CONTROL
RoutingControlArn: !Ref RoutingControlCell1
Type: AWS::Route53::HealthCheck
Properties:
HealthCheckConfig:
FailureThreshold: 3
FullyQualifiedDomainName: !Ref SiteAAliasTarget
Port: 443
Type: AWS::Route53::HealthCheck
Properties:
HealthCheckConfig:
FailureThreshold: 3
FullyQualifiedDomainName: !Ref SiteAAliasTarget
Port: 443
Type: "AWS::Route53::HealthCheck"
Properties:
HealthCheckConfig:
Port: "443"
Type: "HTTPS_STR_MATCH"
SearchString: "ok"
"Type": "AWS::Route53::HealthCheck",
"Properties":{
"HealthCheckConfig":{
"FailureThreshold":{"Ref": "FailureThreshold"},
"FullyQualifiedDomainName" : "wf-automation-master.appspot.com",
"Port":{"Ref": "Port"},
"resourceType" : "AWS::Route53::HealthCheck",
"properties" : [ {
"propertyName" : "HealthCheckConfig",
"propertyType" : "AWS::Route53::HealthCheck::HealthCheckConfig",
"required" : true,
"propertyHref" : "aws-properties-route53-healthcheck-healthcheckconfig.html"
"Type" : "AWS::Route53::HealthCheck",
"Properties" : {
"HealthCheckConfig" : {
"Type" : "CLOUDWATCH_METRIC",
"AlarmIdentifier" : {
"Name" : {
"Type": "AWS::Route53::HealthCheck",
"Properties": {
"HealthCheckConfig": {
"FailureThreshold": 2,
"FullyQualifiedDomainName": {"Fn::GetAtt": ["DesignerDistribution","DomainName"]},
"Port": 443,
"Type": "AWS::Route53::HealthCheck",
"Properties": {
"HealthCheckConfig": {
"FailureThreshold": 2,
"FullyQualifiedDomainName": {
"Ref": "domain"
Parameters
-
HealthCheckConfig
required - Json -
HealthCheckTags
optional - List of HealthCheckTag
Explanation in CloudFormation Registry
The
AWS::Route53::HealthCheck
resource is a Route 53 resource type that contains settings for a Route 53 health check.For information about associating health checks with records, see HealthCheckId in ChangeResourceRecordSets. Note You can't create a health check with simple routing.
ELB Load BalancersIf you're registering EC2 instances with an Elastic Load Balancing (ELB) load balancer, do not create Amazon Route 53 health checks for the EC2 instances. When you register an EC2 instance with a load balancer, you configure settings for an ELB health check, which performs a similar function to a Route 53 health check.
Private Hosted ZonesYou can associate health checks with failover records in a private hosted zone. Note the following:+ Route 53 health checkers are outside the VPC. To check the health of an endpoint within a VPC by IP address, you must assign a public IP address to the instance in the VPC.
You can configure a health checker to check the health of an external resource that the instance relies on, such as a database server.
You can create a CloudWatch metric, associate an alarm with the metric, and then create a health check that is based on the state of the alarm. For example, you might create a CloudWatch metric that checks the status of the Amazon EC2
StatusCheckFailed
metric, add an alarm to the metric, and then create a health check that is based on the state of the alarm. For information about creating CloudWatch metrics and alarms by using the CloudWatch console, see the Amazon CloudWatch User Guide.
Frequently asked questions
What is AWS Route 53 Health Check?
AWS Route 53 Health Check is a resource for Route 53 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Route 53 Health Check?
For Terraform, the wzedi/service-health-dashboard, nzebar/TerraformAWS and awsclint/dollars-demo-terraform source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the jscottcarson/Cloudformation, gerrardcowburn/sandpit and xsoloking/aws-gerrit source code examples are useful. See the CloudFormation Example section for further details.