# HealthCheck

Amazon Route 53 health checks monitor the health and performance of your web applications, web servers, and other resources.

Each health check that you create can monitor one of the following:
- The health of a resource, such as a web server,
- The status of other health checks, and
- The CloudWatch alarm that you specify,
- The status of an Amazon Route 53 routing control.

Extends: Construct › Resource › HealthCheck
Implements: IResource, IHealthCheck, IEnvironmentAware, IHealthCheckRef, IConstruct, IDependable

- CloudFormation: [`AWS::Route53::HealthCheck`](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-route53-healthcheck.html)
- L1 type: [`CfnHealthCheck`](/cdk/api/v2/docs/aws-cdk-lib.aws_route53.CfnHealthCheck.html)
- Source: [`aws-route53/lib/health-check.ts`](https://github.com/aws/aws-cdk/blob/v2.273.0/packages/aws-cdk-lib/aws-route53/lib/health-check.ts#L238)
- Type last changed: v2.234.0 · 8 Jan 2026

## Example

```ts
declare const myZone: route53.HostedZone;

const healthCheck = new route53.HealthCheck(this, 'HealthCheck', {
  type: route53.HealthCheckType.HTTP,
  fqdn: 'example.com',
  port: 80,
  resourcePath: '/health',
  failureThreshold: 3,
  requestInterval: Duration.seconds(30),
});

new route53.ARecord(this, 'ARecordFailoverPrimary', {
  zone: myZone,
  target: route53.RecordTarget.fromIpAddresses('1.2.3.4'),
  failover: route53.Failover.PRIMARY,
  healthCheck,
  setIdentifier: 'failover-primary',
});

new route53.ARecord(this, 'ARecordFailoverSecondary', {
  zone: myZone,
  target: route53.RecordTarget.fromIpAddresses('5.6.7.8'),
  failover: route53.Failover.SECONDARY,
  setIdentifier: 'failover-secondary',
});
```

## Initializer

```ts
new HealthCheck(scope: Construct, id: string, props: HealthCheckProps)
```

## Construct Props

- `alarmIdentifier`: [AlarmIdentifier](/cdk/api/v2/docs/aws-cdk-lib.aws_route53.AlarmIdentifier.html) = if the type is CLOUDWATCH_METRIC, this property is required. Otherwise, it is not configured. — CloudWatch alarm that you want Amazon Route 53 health checkers to use to determine whether the specified health check is healthy.

  **Default:** if the type is CLOUDWATCH_METRIC, this property is required. Otherwise, it is not configured.

- `childHealthChecks`: [IHealthCheck](/cdk/api/v2/docs/aws-cdk-lib.aws_route53.IHealthCheck.html)[] = if the type is CALCULATED, this property is required. Otherwise, it is not configured. — A list of health checks to monitor for this 'CALCULATED' health check.

  **Default:** if the type is CALCULATED, this property is required. Otherwise, it is not configured.

- `enableSNI`: boolean = if the type is HTTPS or HTTPS_STR_MATCH, this property default value is true. Otherwise, it is not configured. — Specify whether you want Amazon Route 53 to send the value of FullyQualifiedDomainName to the endpoint in the client_hello message during TLS negotiation.

  This allows the endpoint to respond to HTTPS health check requests with the applicable SSL/TLS certificate.

  **Default:** if the type is HTTPS or HTTPS_STR_MATCH, this property default value is true. Otherwise, it is not configured.

- `failureThreshold`: number = if the type is CALCULATED it's not configured - if the type is CLOUDWATCH_METRIC it's not configured - otherwise, the default value is 3. — The number of consecutive health checks that an endpoint must pass or fail for Amazon Route 53 to change the current status of the endpoint from unhealthy to healthy or vice versa.

  **Default:** if the type is CALCULATED it's not configured - if the type is CLOUDWATCH_METRIC it's not configured - otherwise, the default value is 3.

- `fqdn`: string = not configured — Fully qualified domain name of the endpoint to be checked.

  Amazon Route 53 behavior depends on whether you specify a value for IPAddress.

  If you specify a value for IPAddress:

  Amazon Route 53 sends health check requests to the specified IPv4 or IPv6 address and passes the value of FullyQualifiedDomainName in the Host header for all health checks except TCP health checks. This is typically the fully qualified DNS name of the endpoint on which you want Route 53 to perform health checks.
  Note: If you specify a value for Port property other than 80 or 443, Route 53 will construct the value for Host header as FullyQualifiedDomainName:Port.

  If you don't specify a value for IPAddress:

  Route 53 sends a DNS request to the domain that you specify for FullyQualifiedDomainName at the interval that you specify for RequestInterval. Using an IPv4 address that DNS returns, Route 53 then checks the health of the endpoint.

  Additionally, if the type of the health check is HTTP, HTTPS, HTTP_STR_MATCH, or HTTPS_STR_MATCH, Route 53 passes the value of FullyQualifiedDomainName in the Host header, as it does when you specify value for IPAddress. If the type is TCP, Route 53 doesn't pass a Host header.

- `healthThreshold`: number = if the type is CALCULATED, the default value is number of child health checks. Otherwise, it is not configured. — The number of child health checks that are associated with a CALCULATED health that Amazon Route 53 must consider healthy for the CALCULATED health check to be considered healthy.

  **Default:** if the type is CALCULATED, the default value is number of child health checks. Otherwise, it is not configured.

- `insufficientDataHealthStatus`: [InsufficientDataHealthStatusEnum](/cdk/api/v2/docs/aws-cdk-lib.aws_route53.InsufficientDataHealthStatusEnum.html) = if the type is CLOUDWATCH_METRIC, the default value is InsufficientDataHealthStatus.LAST_KNOWN_STATUS. Otherwise, it is not configured. — The status of the health check when CloudWatch has insufficient data about the state of associated alarm.

  **Default:** if the type is CLOUDWATCH_METRIC, the default value is InsufficientDataHealthStatus.LAST_KNOWN_STATUS. Otherwise, it is not configured.

- `inverted`: boolean = false — Specify whether you want Amazon Route 53 to invert the status of a health check, so a health check that would normally be considered unhealthy is considered healthy, and vice versa.

- `ipAddress`: string = not configured — The IPv4 or IPv6 IP address for the endpoint that you want Amazon Route 53 to perform health checks on.

  If you don't specify a value for IPAddress, Route 53 sends a DNS request to resolve the domain name that you specify in FullyQualifiedDomainName at the interval that you specify in RequestInterval. Using an IPv4 address that DNS returns, Route 53 then checks the health of the endpoint.

- `measureLatency`: boolean = if the type is CALCULATED it's not configured - if the type is CLOUDWATCH_METRIC it's not configured - otherwise, the default value is false. — Specify whether you want Amazon Route 53 to measure the latency between health checkers in multiple AWS regions and your endpoint, and to display CloudWatch latency graphs on the Health Checks page in the Route 53 console.

  **Default:** if the type is CALCULATED it's not configured - if the type is CLOUDWATCH_METRIC it's not configured - otherwise, the default value is false.

- `port`: number = if the type is HTTP or HTTP_STR_MATCH, the default value is 80. - if the type is HTTPS or HTTPS_STR_MATCH, the default value is 443. - otherwise, it is not configured. — The port on the endpoint that you want Amazon Route 53 to perform health checks on.

  **Default:** if the type is HTTP or HTTP_STR_MATCH, the default value is 80. - if the type is HTTPS or HTTPS_STR_MATCH, the default value is 443. - otherwise, it is not configured.

- `regions`: string[] = if the type is CALCULATED, CLOUDWATCH_METRIC, or RECOVERY_CONTROL, this property is not configured. - otherwise, the default value will be set by CloudFormation itself and will include all valid regions. Please refer to the CloudFormation documentation for the most up-to-date list of regions. — An array of region identifiers that you want Amazon Route 53 health checkers to check the health of the endpoint from.

  Please refer to the CloudFormation documentation for the most up-to-date list of regions.

  **Default:** if the type is CALCULATED, CLOUDWATCH_METRIC, or RECOVERY_CONTROL, this property is not configured. - otherwise, the default value will be set by CloudFormation itself and will include all valid regions. Please refer to the CloudFormation documentation for the most up-to-date list of regions.

- `requestInterval`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = if the type is CALCULATED it's not configured - if the type is CLOUDWATCH_METRIC it's not configured - otherwise, the default value is 30 seconds. — The duration between the time that Amazon Route 53 gets a response from your endpoint and the time that it sends the next health check request.

  Each Route 53 health checker makes requests at this interval.

  **Default:** if the type is CALCULATED it's not configured - if the type is CLOUDWATCH_METRIC it's not configured - otherwise, the default value is 30 seconds.

- `resourcePath`: string = if the type is HTTP, HTTPS, HTTP_STR_MATCH, or HTTPS_STR_MATCH, the default value is empty string. - otherwise, it is not configured. — The path that you want Amazon Route 53 to request when performing health checks.

  The path can be any value for which your endpoint will return an HTTP status code of 2xx or 3xx when the endpoint is healthy, for example the file /docs/route53-health-check.html. Route 53 automatically adds the DNS name for the service and a leading forward slash (/) character.

  **Default:** if the type is HTTP, HTTPS, HTTP_STR_MATCH, or HTTPS_STR_MATCH, the default value is empty string. - otherwise, it is not configured.

- `routingControl`: string = if the type is RECOVERY_CONTROL, this property is required. Otherwise, it is not configured. — The Amazon Resource Name (ARN) of the Route 53 Application Recovery Controller routing control that you want Amazon Route 53 health checkers to use to determine whether the specified health check is healthy.

  **Default:** if the type is RECOVERY_CONTROL, this property is required. Otherwise, it is not configured.

- `searchString`: string = if the type is HTTP_STR_MATCH or HTTPS_STR_MATCH, this property is required. Otherwise, it is not configured. — The string that you want Amazon Route 53 to search for in the response body from the specified resource.

  If the string appears in the response body, Route 53 considers the resource healthy.

  Route 53 considers case when searching for SearchString in the response body.

  **Default:** if the type is HTTP_STR_MATCH or HTTPS_STR_MATCH, this property is required. Otherwise, it is not configured.

- `type`: [HealthCheckType](/cdk/api/v2/docs/aws-cdk-lib.aws_route53.HealthCheckType.html) (required) — The type of health check to be associated with the record.

## Properties

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) (required) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

- `healthCheckId`: string (required) — The ID of the health check.

- `healthCheckRef`: [HealthCheckReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_route53.HealthCheckReference.html) (required) — A reference to a HealthCheck resource.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) (required) — The tree node.

- `PROPERTY_INJECTION_ID`: string (required) (static) — Uniquely identifies this class.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) (required) — The stack in which this resource is defined.

## Methods

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — Override the cross-stack reference strength for this resource.

  When set, any cross-stack reference to this resource will use the specified
  mechanism instead of the global default determined by the
  `@aws-cdk/core:defaultCrossStackReferences` context key. This is useful for
  selectively weakening specific references to avoid the "deadly embrace" problem
  without changing the app-wide default.

  **Parameters**

  - `strength` — - The reference strength to use for this resource.

- `applyRemovalPolicy(policy: RemovalPolicy): void` — Apply the given removal policy to this resource.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).

- `fromHealthCheckId(scope: Construct, id: string, healthCheckId: string): IHealthCheck` (static) — Import an existing health check into this CDK app.

  **Parameters**

  - `scope` — The parent creating construct (usually `this`).
  - `id` — The construct's name.
  - `healthCheckId` — ID of the health check.

  **Returns:** a reference to the existing health check.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `isOwnedResource(construct: IConstruct): boolean` (static) — Returns true if the construct was created by CDK, and false otherwise.

- `isResource(construct: IConstruct): boolean` (static) — Check whether the given construct is a Resource.

- `toString(): string` — Returns a string representation of this construct.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.
