CloudWatch Synthetics
Multi-Check Blueprint
1. Objective ▾
Blueprints are designed to minimize the time and effort to launch solutions that address common use cases. This is a multi-check canary that monitors a HTTP endpoint and performs the following network-level validations.
| Check Type | Assertion |
|---|---|
| HTTP | 200 OK Response Code |
| Response Time < 3000 ms | |
| TCP | Connection successful |
| Response Time < 3000 ms | |
| DNS | Returns 4 records (CloudFront) |
| TTL < 300 second | |
| Response Time < 1000 ms | |
| Certificate | Certificate is valid |
| Expiry not within 30 days | |
| Issuer is Amazon | |
Subject contains rtaa.ninja | |
| Cipher suite should use AES Encryption |
2. Configuration ▸
Below is the corresponding JSON configuration.
JSON
{
"variables": {
"baseUrl": "https://cloudwatch.rtaa.ninja/",
"baseHostname": "cloudwatch.rtaa.ninja"
},
"steps": {
"1": {
"stepName": "base_http_check",
"checkerType": "HTTP",
"httpMethod": "GET",
"url": "${baseUrl}",
"assertions": [
{
"type": "STATUS_CODE",
"operator": "EQUALS",
"value": 200
},
{
"type": "RESPONSE_TIME",
"operator": "LESS_THAN",
"value": 3000
}
]
},
"2": {
"stepName": "base_dns_txt_check",
"checkerType": "DNS",
"domain": "${baseHostname}",
"recordType": "A",
"nameserver": "8.8.8.8",
"timeout": 5000,
"port": 53,
"protocol": "TCP",
"assertions": [
{
"type": "RECORD_COUNT",
"operator": "EQUALS",
"value": 4
},
{
"type": "TTL",
"operator": "LESS_THAN",
"value": 300
},
{
"type": "RESPONSE_TIME",
"operator": "LESS_THAN",
"value": 1000
}
]
},
"3": {
"stepName": "base_ssl_certificate_check",
"checkerType": "SSL",
"hostname": "${baseHostname}",
"port": 443,
"timeout": 100000,
"sni": true,
"verifyHostname": true,
"allowSelfSigned": false,
"assertions": [
{
"type": "CERTIFICATE_VALID",
"value": true,
"description": "Certificate should be valid"
},
{
"type": "CERTIFICATE_EXPIRY",
"operator": "GREATER_THAN",
"value": 30,
"unit": "DAYS",
"description": "Certificate should not expire within 30 days"
},
{
"type": "CERTIFICATE_SUBJECT",
"field": "CN",
"operator": "CONTAINS",
"value": "rtaa.ninja",
"description": "Certificate CN should contain rtaa.ninja"
},
{
"type": "CERTIFICATE_ISSUER",
"field": "O",
"operator": "CONTAINS",
"value": "Amazon",
"description": "Certificate should be issued by Amazon"
},
{
"type": "CIPHER_SUITE",
"operator": "CONTAINS",
"value": "AES",
"description": "Cipher suite should use AES encryption"
}
]
},
"4": {
"stepName": "base_tcp_connection_check",
"checkerType": "TCP",
"hostname": "${baseHostname}",
"port": 443,
"timeout": 5000,
"encoding": "UTF-8",
"assertions": [
{
"type": "CONNECTION_SUCCESSFUL",
"value": true,
"description": "TCP connection should be successful"
},
{
"type": "RESPONSE_TIME",
"operator": "LESS_THAN",
"value": 3000,
"description": "Response time should be less than 3 seconds"
}
]
}
}
}
Fig 1: Multi-step check results in the CloudWatch Synthetics console