Terraform AWS Route53 Healthcheck Module
Managed by @igorkotof
The module creates:
- SNS Topic
- SNS Subscription (e.g. PagerDuty)
- Route53 Healthcheck
- Cloudwatch Metric Alarm
- (optional) Secondary Route53 record for failover routing policy to public S3 website with "Maintenance page"
- (optional) S3 public website with "Maintenance page" (bucket name = var.fqdn)
We will monitor s3-static-website.s3-website-us-east-1.amazonaws.com with PagerDuty notification with failover routing policy to S3 public website bucket with "Maintenance page"
module "route53-health-check" {
source = "hazelops/route53-healthcheck/aws""
env = "production"
name = "my-monitoring"
port = "80"
type = "HTTP"
fqdn = "s3-static-website.s3-website-us-east-1.amazonaws.com"
subscription_endpoint = "https://events.pagerduty.com/integration/<Integration_Key>/enqueue"
r53_failover_enabled = true
domain_name = "example.com"
}
Note: This module just creates a secondary Route53 record for failover routing policy. Creating a primary record is out of scope of this module.
Name | Version |
---|---|
terraform | >= 1.1 |
aws | >= 3.0 |
Name | Version |
---|---|
aws | >= 3.0 |
No modules.
Name | Type |
---|---|
aws_cloudwatch_metric_alarm.this | resource |
aws_route53_health_check.this | resource |
aws_route53_record.this | resource |
aws_s3_bucket.this | resource |
aws_s3_bucket_acl.this | resource |
aws_s3_bucket_policy.this | resource |
aws_s3_bucket_website_configuration.this | resource |
aws_sns_topic.this | resource |
aws_sns_topic_subscription.this | resource |
aws_region.current | data source |
aws_route53_zone.this | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
cw_alarm_comparison_operator | Comparison Operator of Cloudwatch metric alarm | string |
"LessThanThreshold" |
no |
cw_alarm_evaluation_periods | Evaluation periods of Cloudwatch metric alarm | string |
"1" |
no |
cw_alarm_metric_name | Metric name of Cloudwatch metric alarm | string |
"HealthCheckStatus" |
no |
cw_alarm_namespace | Namespace of Cloudwatch metric alarm | string |
"AWS/Route53" |
no |
cw_alarm_period | Period of Cloudwatch metric alarm | string |
"60" |
no |
cw_alarm_statistic | Statistic of Cloudwatch metric alarm | string |
"Minimum" |
no |
cw_alarm_threshold | Threshold of Cloudwatch metric alarm | string |
"1" |
no |
cw_alarm_unit | Unit of Cloudwatch metric alarm | string |
"None" |
no |
domain_name | n/a | any |
n/a | yes |
enabled | Gives ability to enable or disable a module | bool |
true |
no |
endpoint_auto_confirms | Endpoint endpoint for SNS topic subscription, PagerDuty (https://events.pagerduty.com/integration//enqueue) | bool |
true |
no |
env | n/a | any |
n/a | yes |
failure_threshold | The number of consecutive health checks that an endpoint must pass or fail. | string |
"3" |
no |
fqdn | The FQDN of the endpoint to be monitored | string |
n/a | yes |
name | The name of the monitoring and name of the subscription service endpoint | string |
n/a | yes |
port | The port of the endpoint to be monitored | string |
"443" |
no |
r53_failover_enabled | Enabling creating secondary Failover R53 Record | bool |
false |
no |
request_interval | The number of seconds between the time that Amazon Route 53 gets a response from your endpoint and the time that it sends the next health-check request. | string |
"30" |
no |
resource_path | The path that you want Amazon Route 53 to request when performing health checks. | string |
"/" |
no |
subscription_endpoint | Endpoint endpoint for SNS topic subscription, PagerDuty, Slack etc. | string |
n/a | yes |
subscription_endpoint_protocol | Endpoint protocol for SNS topic subscription | string |
"https" |
no |
type | The protocol to use when performing health checks. Valid values are HTTP, HTTPS, HTTP_STR_MATCH, HTTPS_STR_MATCH, TCP, CALCULATED and CLOUDWATCH_METRIC | string |
"HTTPS" |
no |
No outputs.