This rule ensures that auto scaling groups with a load balancer utilize health checks for optimal performance.
Rule | Auto Scaling groups with a load balancer should use health checks |
Framework | FedRAMP Low Revision 4 |
Severity | ✔ Critical |
Rule Description:
Auto Scaling groups with a load balancer should utilize health checks to ensure the health and availability of instances. This rule is applicable for FedRAMP Low Revision 4 compliance.
Troubleshooting steps:
Necessary codes:
The following code snippets can be used to configure health checks for an Auto Scaling group and load balancer.
CLI Command for configuring health checks for Auto Scaling group:
aws autoscaling put-lifecycle-hook --auto-scaling-group-name <auto_scaling_group_name> --lifecycle-hook-name <lifecycle_hook_name> --heartbeat-timeout <timeout_seconds> --default-result <default_result> --heartbeat-timeout-action <timeout_action>
Replace the following placeholders:
<auto_scaling_group_name>
: Name of the Auto Scaling group.<lifecycle_hook_name>
: Name of the lifecycle hook.<timeout_seconds>
: Timeout period for the heartbeat.<default_result>
: Default result for the lifecycle hook.<timeout_action>
: Action to take when heartbeat timeout occurs.CLI Command for configuring health checks for the load balancer:
aws elbv2 modify-target-group --target-group-arn <target_group_arn> --health-check-protocol <protocol> --health-check-path <path> --health-check-interval-seconds <interval_seconds> --healthy-threshold-count <healthy_threshold> --unhealthy-threshold-count <unhealthy_threshold>
Replace the following placeholders:
<target_group_arn>
: ARN of the target group associated with the load balancer.<protocol>
: Health check protocol (HTTP, HTTPS, TCP, etc.).<path>
: Path to be used for health checks.<interval_seconds>
: Interval between health checks in seconds.<healthy_threshold>
: Number of consecutive successful health checks required for an instance to be considered healthy.<unhealthy_threshold>
: Number of consecutive unsuccessful health checks required for an instance to be considered unhealthy.Step-by-Step Guide for Remediation:
put-lifecycle-hook
command to set the heartbeat timeout, default result, and timeout action.modify-target-group
command to specify the health check protocol, path, interval, healthy threshold, and unhealthy threshold.Following these steps will ensure that your Auto Scaling group with a load balancer is utilizing health checks to meet the requirements of FedRAMP Low Revision 4 compliance.