# Ec2HealthCheckOptions

EC2 Heath check options.

Used as argument in: [HealthCheck.ec2](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.HealthCheck.html#ec2)

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

## Example

TypeScript:

```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 ec2HealthCheckOptions: autoscaling.Ec2HealthCheckOptions = {
  grace: cdk.Duration.minutes(30),
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_autoscaling as autoscaling

ec2_health_check_options = autoscaling.Ec2HealthCheckOptions(
    grace=cdk.Duration.minutes(30)
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.autoscaling.*;

Ec2HealthCheckOptions ec2HealthCheckOptions = Ec2HealthCheckOptions.builder()
        .grace(Duration.minutes(30))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.AutoScaling;

var ec2HealthCheckOptions = new Ec2HealthCheckOptions {
    Grace = Duration.Minutes(30)
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

ec2HealthCheckOptions := &Ec2HealthCheckOptions{
	Grace: cdk.Duration_Minutes(jsii.Number(30)),
}
```

## Properties

- `grace`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.seconds(0) — Specified the time Auto Scaling waits before checking the health status of an EC2 instance that has come into service.
