# HealthCheck

Contains static factory methods for creating health checks for different protocols.

- Source: [`aws-appmesh/lib/health-checks.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-appmesh/lib/health-checks.ts#L96)

## Example

```ts
const vpc = new ec2.Vpc(this, 'vpc');
const namespace = new cloudmap.PrivateDnsNamespace(this, 'test-namespace', {
    vpc,
    name: 'domain.local',
});
const service = namespace.createService('Svc');

declare const mesh: appmesh.Mesh;
const node = mesh.addVirtualNode('virtual-node', {
  serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service),
  listeners: [appmesh.VirtualNodeListener.http({
    port: 8081,
    healthCheck: appmesh.HealthCheck.http({
      healthyThreshold: 3,
      interval: Duration.seconds(5), // minimum
      path: '/health-check-path',
      timeout: Duration.seconds(2), // minimum
      unhealthyThreshold: 2,
    }),
  })],
  accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'),
});
```

## Initializer

```ts
new HealthCheck()
```

## Methods

- `bind(scope: Construct, options: HealthCheckBindOptions): HealthCheckConfig` — Called when the AccessLog type is initialized.

  Can be used to enforce
  mutual exclusivity with future properties

- `grpc(options?: GrpcHealthCheckOptions): HealthCheck // chainable` (static) — Construct a GRPC health check.

- `http(options?: HttpHealthCheckOptions): HealthCheck // chainable` (static) — Construct a HTTP health check.

- `http2(options?: HttpHealthCheckOptions): HealthCheck // chainable` (static) — Construct a HTTP2 health check.

- `tcp(options?: TcpHealthCheckOptions): HealthCheck // chainable` (static) — Construct a TCP health check.
