Scenario
Your infrastructure has two application endpoints that need different monitoring strategies via Route 53 health checks.
Task
| Service name |
web-server |
api-server |
| IP address |
10.0.1.10 |
10.0.2.10 |
| Protocol |
HTTP |
HTTPS |
| Port |
80 |
443 |
| Path |
/health |
- |
| Failure threshold |
3 |
5 |
| Request interval |
30 seconds (standard) |
10 seconds (fast) |
| Invert health check status |
No |
Yes |
| Health check regions |
Default (all) |
US East (N. Virginia), EU (Ireland), Asia Pacific (Singapore) |
Note: You can use either the AWS Management Console or AWS CLI to complete this task.
Step 1: Create the web-server health check
WEB_HC=$(aws route53 create-health-check \
--caller-reference "web-server-$(date +%s)" \
--health-check-config '{
"IPAddress": "10.0.1.10",
"Port": 80,
"Type": "HTTP",
"ResourcePath": "/health",
"FailureThreshold": 3,
"RequestInterval": 30
}' --query 'HealthCheck.Id' --output text)
Creates a standard HTTP health check that monitors port 80 at /health every 30 seconds, marking unhealthy after 3 consecutive failures.
Step 2: Name the web-server health check
aws route53 change-tags-for-resource \
--resource-type healthcheck \
--resource-id "$WEB_HC" \
--add-tags Key=Name,Value=web-server
Health check names are stored as tags, not as a direct property.
Step 3: Create the api-server health check
API_HC=$(aws route53 create-health-check \
--caller-reference "api-server-$(date +%s)" \
--health-check-config '{
"IPAddress": "10.0.2.10",
"Port": 443,
"Type": "HTTPS",
"FailureThreshold": 5,
"RequestInterval": 10,
"Inverted": true,
"Regions": ["us-east-1", "eu-west-1", "ap-southeast-1"]
}' --query 'HealthCheck.Id' --output text)
Creates an HTTPS health check with fast 10-second interval, inverted status (reports healthy when endpoint is down), and monitors from only 3 specific regions.
Step 4: Name the api-server health check
aws route53 change-tags-for-resource \
--resource-type healthcheck \
--resource-id "$API_HC" \
--add-tags Key=Name,Value=api-server
Step 5: Verify both health checks
aws route53 list-health-checks --query 'HealthChecks[].{Id:Id, IP:HealthCheckConfig.IPAddress, Type:HealthCheckConfig.Type, Port:HealthCheckConfig.Port, Threshold:HealthCheckConfig.FailureThreshold, Interval:HealthCheckConfig.RequestInterval, Inverted:HealthCheckConfig.Inverted}'
Lists all health checks with their configuration to confirm both are set up correctly.