# HealthCheck

Health check settings.

- Source: [`aws-autoscaling/lib/auto-scaling-group.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts#L2661)
- Type last changed: v2.182.0 · 5 Mar 2025

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';
const healthCheck = autoscaling.HealthCheck.ec2(/* all optional props */ {
  grace: cdk.Duration.minutes(30),
});
```

## Properties

- `gracePeriod`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html)

- `type`: string

## Methods

- `ec2(options?: Ec2HealthCheckOptions): HealthCheck // chainable` (static) — Use EC2 for health checks.

  **Parameters**

  - `options` — EC2 health check options.

- `elb(options: ElbHealthCheckOptions): HealthCheck // chainable` (static) — Use ELB for health checks.

  It considers the instance unhealthy if it fails either the EC2 status checks or the load balancer health checks.

  **Parameters**

  - `options` — ELB health check options.
