
I Tried Out Amazon Route 53 Private Endpoint Health Checks
This page has been translated by machine translation. View original
Introduction
On November 19, 2026, Amazon Route 53 announced Private Endpoint Health Checks.
This feature lets you make private endpoints inside a VPC the target of Route 53 health checks.
You can monitor internal load balancers and nodes in private subnets, and use the results for DNS failover. In this article, I created a health check source, ran health checks against internal ALBs, tried DNS failover, and checked the pricing.
Test Environment
- Region: Tokyo (ap-northeast-1)
- aws-cli: 2.41.2
- Network: 1 VPC, 1 subnet each in AZ IDs apne1-az1 / apne1-az2 / apne1-az4
- Internal ALBs: 2 (ALB 1, ALB 2). The two ALBs share one security group
- Listeners: HTTP 80, HTTPS 443. Fixed response (status 200, text/plain); the body is alb1 OK for ALB 1 and alb2 OK for ALB 2
- Certificate: ACM wildcard certificate
*.example.com - Hosted zone: Existing public hosted zone example.com. Added alias A records alb1.example.com / alb2.example.com pointing to ALB 1 / ALB 2
- Lambda in the VPC: Python 3.12, handler
lambda_function.handler. Used to verify name resolution and HTTPS fetches. The ALB security group allows TCP 80 and 443 from the Lambda security group - Common health check settings:
EndpointType=PRIVATE, interval 30 seconds, failure threshold 3 - Times: JST
Lambda code (lambda_function.py)
import socket, json, urllib.request
def handler(event, context):
out = {}
for name in event.get("names", []):
try:
out[name] = sorted({a[4][0] for a in socket.getaddrinfo(name, 443, socket.AF_INET)})
except Exception as e:
out[name] = repr(e)
fetch = event.get("fetch")
if fetch:
try:
out["body"] = urllib.request.urlopen("https://%s/" % fetch, timeout=5).read().decode()
except Exception as e:
out["body"] = repr(e)
return out
Health Check Source
A health check source is a resource that defines the VPC, subnets, and security groups from which health check requests are sent.
Creation
Save a configuration file specifying the VPC, along with a subnet and security group for each AZ ID, as health-check-source.json.
{"VpcId":"vpc-0a1b2c3d4e5f60000","SubnetConfigurationList":[
{"SubnetId":"subnet-0a1b2c3d4e5f60001","AvailabilityZoneId":"apne1-az1","SecurityGroupIdList":["sg-0a1b2c3d4e5f60001"]},
{"SubnetId":"subnet-0a1b2c3d4e5f60002","AvailabilityZoneId":"apne1-az2","SecurityGroupIdList":["sg-0a1b2c3d4e5f60001"]},
{"SubnetId":"subnet-0a1b2c3d4e5f60003","AvailabilityZoneId":"apne1-az4","SecurityGroupIdList":["sg-0a1b2c3d4e5f60001"]}]}
For --caller-reference, specify any unique string.
aws route53 create-health-check-source --caller-reference <CALLER_REFERENCE> --health-check-source-config file://health-check-source.json
{
"HealthCheckSourceId": "<HEALTH_CHECK_SOURCE_ID>",
"HealthCheckSourceStatus": "CREATE_PENDING"
}
The status progresses from CREATE_PENDING through CREATE_IN_PROGRESS to CREATE_COMPLETED, and it took about 5 minutes to complete. Create the health checks only after confirming CREATE_COMPLETED with the following command.
aws route53 get-health-check-source --health-check-source-id <HEALTH_CHECK_SOURCE_ID>
The VPC, subnets, and security groups are fixed by what you specify at creation. To change the configuration, create a new source, reattach the health checks, and delete the old source.
Leave the outbound rules of the health check source security group (sg-0a1b2c3d4e5f60001) at the default allow-all. For the ALB security group (sg-0a1b2c3d4e5f60002), allow TCP 80 and 443 from the health check source security group.
aws ec2 authorize-security-group-ingress --group-id sg-0a1b2c3d4e5f60002 --ip-permissions 'IpProtocol=tcp,FromPort=443,ToPort=443,UserIdGroupPairs=[{GroupId=sg-0a1b2c3d4e5f60001,Description=hc-source-https}]' 'IpProtocol=tcp,FromPort=80,ToPort=80,UserIdGroupPairs=[{GroupId=sg-0a1b2c3d4e5f60001,Description=hc-source-http}]'
Service-Linked Role
When the health check source was created, the service-linked role AWSServiceRoleForRoute53PrivateHealthChecks was created automatically. Its path is /aws-service-role/route53healthchecks.amazonaws.com/.
The trust policy allows sts:AssumeRole for the service principal route53healthchecks.amazonaws.com. The AWS managed policy Route53PrivateHealthChecksServiceRolePolicy is attached.
Contents of Route53PrivateHealthChecksServiceRolePolicy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:CreateNetworkInterface",
"Condition": {
"StringLike": {
"aws:RequestTag/Name": "healthchecksource-*"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": [
"Name"
]
}
},
"Resource": "arn:aws:ec2:*:*:network-interface/*"
},
{
"Effect": "Allow",
"Action": "ec2:CreateNetworkInterface",
"Resource": [
"arn:aws:ec2:*:*:security-group/*",
"arn:aws:ec2:*:*:subnet/*"
]
},
{
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Condition": {
"StringEquals": {
"ec2:CreateAction": "CreateNetworkInterface"
},
"StringLike": {
"aws:RequestTag/Name": "healthchecksource-*"
}
},
"Resource": "arn:aws:ec2:*:*:network-interface/*"
},
{
"Effect": "Allow",
"Action": "ec2:DeleteNetworkInterface",
"Condition": {
"StringLike": {
"ec2:ResourceTag/Name": "healthchecksource-*"
}
},
"Resource": "arn:aws:ec2:*:*:network-interface/*"
},
{
"Effect": "Allow",
"Action": [
"ec2:DescribeNetworkInterfaces",
"ec2:DescribeSecurityGroups",
"ec2:DescribeVpcs",
"ec2:DescribeSubnets"
],
"Resource": "*"
}
]
}
Even if the role already exists, iam:CreateServiceLinkedRole is called with the credentials that made the request every time a health check source is created or deleted. If you use a custom policy, make sure not to remove this permission.
Health Checks
Checking the Status
Check the status with HealthCheckStatus in CloudWatch's AWS/Route53 namespace (1 is Healthy, 0 is Unhealthy). The metrics were recorded in ap-northeast-1, where the health check source was created. The command to get the Minimum at 1-minute granularity is as follows.
aws cloudwatch get-metric-statistics --region ap-northeast-1 --namespace AWS/Route53 --metric-name HealthCheckStatus --dimensions Name=HealthCheckId,Value=<HEALTH_CHECK_ID> --start-time <START_TIME> --end-time <END_TIME> --period 60 --statistics Minimum --query 'sort_by(Datapoints,&Timestamp)[].[Timestamp,Minimum]' --output text
The datapoint for the 1-minute interval containing the creation time is 1 from the start, so to confirm Healthy, use the values from the following minute onward.
IP Address Specification
When I resolved the DNS name of ALB 1 from the Lambda in the VPC, three IP addresses (10.0.1.101, 10.0.2.102, 10.0.3.103) were returned. These are the IP addresses of the ENIs in each AZ. For the IP specification, I used 10.0.1.101 among them.
Save the following configuration as hc-ip-https.json.
{
"CallerReference": "ip-https-1",
"HealthCheckConfig": {
"Port": 443,
"Type": "HTTPS",
"ResourcePath": "/",
"RequestInterval": 30,
"FailureThreshold": 3,
"EndpointType": "PRIVATE",
"HealthCheckSourceId": "<HEALTH_CHECK_SOURCE_ID>",
"IPAddress": "10.0.1.101"
}
}
aws route53 create-health-check --cli-input-json file://hc-ip-https.json
For the HTTP health check, create it by changing the following three items: CallerReference to a different string, Type to HTTP, and Port to 80.
The IP-specified HTTP and HTTPS health checks created at 20:11 were both 1 (Healthy) in each datapoint from 20:12 to 20:15.
FQDN Specification
For the FQDN, I used alias A records pointing to the ALBs, added to the existing public hosted zone. For the HostedZoneId of AliasTarget, specify the ALB's CanonicalHostedZoneId. Save the following content as alb-alias-records.json.
{"Changes":[
{"Action":"CREATE","ResourceRecordSet":{"Name":"alb1.example.com","Type":"A","AliasTarget":{"HostedZoneId":"Z14GRHDCWA56QT","DNSName":"internal-alb1-1234567890.ap-northeast-1.elb.amazonaws.com","EvaluateTargetHealth":false}}},
{"Action":"CREATE","ResourceRecordSet":{"Name":"alb2.example.com","Type":"A","AliasTarget":{"HostedZoneId":"Z14GRHDCWA56QT","DNSName":"internal-alb2-1234567891.ap-northeast-1.elb.amazonaws.com","EvaluateTargetHealth":false}}}]}
aws route53 change-resource-record-sets --hosted-zone-id <HOSTED_ZONE_ID> --change-batch file://alb-alias-records.json
When I resolved alb1.example.com from the Lambda in the VPC, the three IPs of ALB 1 were returned. Save the configuration that specifies this record as FullyQualifiedDomainName as hc-fqdn-https.json.
{
"CallerReference": "fqdn-https-1",
"HealthCheckConfig": {
"Port": 443,
"Type": "HTTPS",
"ResourcePath": "/",
"RequestInterval": 30,
"FailureThreshold": 3,
"EndpointType": "PRIVATE",
"HealthCheckSourceId": "<HEALTH_CHECK_SOURCE_ID>",
"FullyQualifiedDomainName": "alb1.example.com"
}
}
aws route53 create-health-check --cli-input-json file://hc-fqdn-https.json
For HTTP, as with the IP-specified HTTP, create it by changing CallerReference, Type, and Port. The FQDN-specified HTTP and HTTPS health checks were also both 1 (Healthy) in each datapoint from 20:12 to 20:15.
Access Logs
For the four health checks in total (IP-specified and FQDN-specified, HTTP and HTTPS), here are the destinations recorded in the request field of ALB 1's access logs.
| Specification | Protocol | Destination in request |
|---|---|---|
| IP only | HTTP | 10.0.1.101:80 |
| IP only | HTTPS | 10.0.1.101:443 |
| FQDN only | HTTP | alb1.example.com:80 |
| FQDN only | HTTPS | alb1.example.com:443 |
With IP-only specification the destination is the IP, and with FQDN specification the destination is the FQDN. The trailing :80 and :443 are notation added by the ALB access log format. The CLI help says that for HTTP on port 80 and HTTPS on port 443, the FQDN is put into the Host header as is.
DNS Failover
Record Configuration
I created failover records for app.example.com in the existing public hosted zone. PRIMARY is an alias to ALB 1, with the FQDN-specified HTTPS health check associated via HealthCheckId. SECONDARY is an alias to ALB 2. Save the following content as failover-records.json.
{"Changes":[
{"Action":"CREATE","ResourceRecordSet":{"Name":"app.example.com","Type":"A","SetIdentifier":"primary-alb1","Failover":"PRIMARY","HealthCheckId":"<HEALTH_CHECK_ID>","AliasTarget":{"HostedZoneId":"Z14GRHDCWA56QT","DNSName":"internal-alb1-1234567890.ap-northeast-1.elb.amazonaws.com","EvaluateTargetHealth":false}}},
{"Action":"CREATE","ResourceRecordSet":{"Name":"app.example.com","Type":"A","SetIdentifier":"secondary-alb2","Failover":"SECONDARY","AliasTarget":{"HostedZoneId":"Z14GRHDCWA56QT","DNSName":"internal-alb2-1234567891.ap-northeast-1.elb.amazonaws.com","EvaluateTargetHealth":false}}}]}
aws route53 change-resource-record-sets --hosted-zone-id <HOSTED_ZONE_ID> --change-batch file://failover-records.json
A PRIVATE health check could be registered on a record in a public hosted zone.
I checked the DNS responses in the following two ways. The response of the public hosted zone can be checked with aws route53 test-dns-answer, and before the blocking described later, the IPs of ALB 1 were returned.
aws route53 test-dns-answer --hosted-zone-id <HOSTED_ZONE_ID> --record-name app.example.com --record-type A
"RecordData": [
"10.0.2.102",
"10.0.3.103",
"10.0.1.101"
]
The response as seen from inside the VPC was checked by using the Lambda to resolve the name and fetch https://app.example.com/. Before the blocking described later, the body was alb1 OK.
aws lambda invoke --function-name <FUNCTION_NAME> --cli-binary-format raw-in-base64-out --payload '{"names":["app.example.com"],"fetch":"app.example.com"}' /dev/stdout | jq -c .
{"app.example.com":["10.0.1.101","10.0.2.102","10.0.3.103"],"body":"alb1 OK"}
Blocking and Switchover
I blocked the health checks by deleting from the ALB security group the two inbound rules (TCP 80 and 443) whose source is the health check source security group. Save the following content as block-rules.json and specify it for the rules to delete.
[{"IpProtocol":"tcp","FromPort":443,"ToPort":443,"UserIdGroupPairs":[{"GroupId":"sg-0a1b2c3d4e5f60001","Description":"hc-source-https"}]},{"IpProtocol":"tcp","FromPort":80,"ToPort":80,"UserIdGroupPairs":[{"GroupId":"sg-0a1b2c3d4e5f60001","Description":"hc-source-http"}]}]
aws ec2 revoke-security-group-ingress --group-id sg-0a1b2c3d4e5f60002 --ip-permissions file://block-rules.json
To recover, run the authorize-security-group-ingress from the health check source section with the same content to restore the rules.
The blocking was at 20:15:14 and the recovery at 20:18:29. HealthCheckStatus of the four health checks changed as follows, using the Minimum at 1-minute granularity.
| Health check | 20:15 | 20:16 | 20:17 | 20:18 | 20:19 | 20:20 |
|---|---|---|---|---|---|---|
| IP-specified HTTP | 1 | 0 | 0 | 0 | 0 | 1 |
| IP-specified HTTPS | 1 | 1 | 0 | 0 | 0 | 1 |
| FQDN-specified HTTP | 1 | 0 | 0 | 0 | 0 | 1 |
| FQDN-specified HTTPS | 1 | 0 | 0 | 0 | 0 | 1 |
The response switchovers are as follows. The times in the table are when the change was first observed. Observations were made at intervals of about 4 to 5 seconds.
| Time | Operation / Observation | Elapsed time since blocking or recovery |
|---|---|---|
| 20:15:14 | Rules deleted (blocking) | |
| 20:16:44 | test-dns-answer changed to the IPs of ALB 2 (10.0.1.201, 10.0.2.202, 10.0.3.203) | about 1 min 30 sec |
| 20:17:29 | Lambda body changed to alb2 OK | about 2 min 15 sec |
| 20:18:29 | Rules re-added (recovery) | |
| 20:19:52 | test-dns-answer changed to the IPs of ALB 1 | about 1 min 23 sec |
| 20:20:37 | Lambda body changed to alb1 OK | about 2 min 8 sec |
These values are for a configuration with an interval of 30 seconds and a failure threshold of 3 (no fast interval). The switchover as seen from the Lambda in the VPC lagged behind test-dns-answer by about 45 seconds at both blocking and recovery.
Pricing
Unit Prices
| Item | Unit price |
|---|---|
| Health check source | $0.125 / hour / AZ (minimum 3 AZs, hourly billing) |
| Health check (HTTP) | $0.50 / month (prorated daily) |
| Health check (HTTPS) | HTTP price plus $1.00 / month (prorated daily) |
Since a health check source is billed hourly for a minimum of 3 AZs, leaving it in place for 30 days comes to 0.125 × 3 × 24 × 30 = $270.
Unit Prices for Conventional (Public) Health Checks
| Item | AWS endpoint | Non-AWS endpoint |
|---|---|---|
| Basic | $0.50 / month (prorated daily) | $0.75 / month (prorated daily) |
| Optional features (HTTPS, string matching, fast interval, latency measurement) | $1.00 / feature / month (prorated daily) | $2.00 / feature / month (prorated daily) |
Summary
With Private Endpoint Health Checks, I was able to set up health checks for internal ALBs and confirm that Route 53 failover works.
Conventional Route 53 health checks were public-only, and achieving health checks and failover for internal ALBs required a combination of a Lambda that performs the health checks, CloudWatch alarms, and the Route 53 API. With Private Endpoint Health Checks, you can achieve this without building that combination yourself.
Note that because health check sources are billed hourly, the monthly cost is higher than with public health checks.
