Control: Unnecessary health checks should be deleted
Description
When you associate health checks with an endpoint, health check requests are sent to the endpoint's IP address. These health check requests are sent to validate that the requests are operating as intended. Health check charges are incurred based on their associated endpoints. To avoid health check charges, delete any health checks that aren't used with an RRset record and are no longer required.
Usage
Run the control in your terminal:
powerpipe control run aws_thrifty.control.route53_health_check_unused
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_thrifty.control.route53_health_check_unused --share
Steampipe Tables
SQL
with health_check as ( select r.health_check_id as health_check_id from aws_route53_zone as z, aws_route53_record as r where r.zone_id = z.id)select 'arn:' || h.partition || ':route53:::healthcheck/' || h.id as resource, case when c.health_check_id is null then 'alarm' else 'ok' end as status, case when c.health_check_id is null then h.title || ' is unnecessary.' else h.title || ' is necessary.' end as reason , region, account_idfrom aws_route53_health_check as h left join health_check as c on h.id = c.health_check_id;