Skip to content

Latest commit

 

History

History
2088 lines (1272 loc) · 84.6 KB

API.md

File metadata and controls

2088 lines (1272 loc) · 84.6 KB

PRs Welcome GitHub npm (scoped) PyPI Nuget Sonatype Nexus (Releases) GitHub Workflow Status (branch) GitHub release (latest SemVer) Gitpod ready-to-code

AWS CDK Route53 HealthCheck

Create Route53 HealthChecks to monitor TCP, HTTP, HTTPS endpoints, to monitor CloudWatch Alarms and to monitor other Route53 HealthChecks.

Currently supported types of Route53 HealthChecks:

Easily create a CloudWatch Alarm based on the Route53 HealthCheck:

const healthCheck = new EndpointHealthCheck(scope, "HealthCheck", {
  domainName: "pepperize.com",
});

const alarm = new cloudwatch.Alarm(scope, "Alarm", {
  metric: healthCheck.metricHealthCheckStatus(),
  comparisonOperator: cloudwatch.ComparisonOperator.LESS_THAN_THRESHOLD,
  threshold: 1,
  evaluationPeriods: 1,
});

See more options API Reference

Install

TypeScript

npm install @pepperize/cdk-route53-health-check

or

yarn add @pepperize/cdk-route53-health-check

Python

pip install pepperize.cdk-route53-health-check

C# / .Net

dotnet add package Pepperize.CDK.Route53HealthCheck

Java

<dependency>
  <groupId>com.pepperize</groupId>
  <artifactId>cdk-route53-health-check</artifactId>
  <version>${cdkRoute53HealthCheck.version}</version>
</dependency>

Usage

npm install @pepperize/cdk-route53-health-check

See API.md.

HealthCheck for an endpoint

HTTPS health check

new EndpointHealthCheck(scope, "HealthCheck", {
  domainName: "pepperize.com",
});

Generates

Resources:
  Type: AWS::Route53::HealthCheck
  Properties:
    HealthCheckConfig:
      FullyQualifiedDomainName: "pepperize.com"
      Port: 443
      Type: "HTTPS"
      EnableSNI: true

Additional configuration options

new EndpointHealthCheck(scope, "HealthCheck", {
  domainName: "pepperize.com", // The domain name that Route53 performs health checks on. Route53 resolves the IP address and performs the lookup.
  enableSni: true, // Specify that Route53 sends the host name for TLS negotiation.
  failureThreshold: 3, // The number of consecutive health checks that an endpoint must pass or fail for Route53 to change the current status of the endpoint between healthy and unhealthy.
  healthCheckName: "pepperize.com", //	The display name of this Route53 HealthCheck.
  inverted: false, // Whether to invert the status of the Route53 health check status.
  ipAddress: "1.1.1.1", // The ip address that Route53 performs health checks on. Optionally a domain name may be given.
  latencyGraphs: true, // Whether Route53 measures the latency between health checkers in multiple AWS regions and your endpoint, and displays a CloudWatch latency graphs in the Route53 console.
  port: 443, // The port that Route53 performs health checks.
  protocol: Protocol.HTTPS, // The protocol that Route53 uses to communicate with the endpoint.
  regions: [HealthCheckerRegions.EU_WEST_1, HealthCheckerRegions.US_EAST_1, HealthCheckerRegions.US_WEST_1], // The list of regions from which Route53 health checkers check the endpoint.
  requestInterval: 30, // The number of seconds between the time that Route53 gets a response from your endpoint and the time that it sends the next health check request.
  resourcePath: "/health-check", // The path for HTTP or HTTPS health checks.
  searchString: "OK", // The search string for HTTP or HTTPS health checks.
});

See for more options API Reference - EndpointHealthCheckProps

HealthCheck to monitor other HealthChecks

const healthCheck1 = new EndpointHealthCheck(stack, "HealthCheck1", {
  domainName: "pepperize.com",
});
const healthCheck2 = EndpointHealthCheck.fromHealthCheckId(
  scope,
  "HealthCheck2",
  "9ebee2db-6292-4803-9838-327e6example"
);
new CalculatedHealthCheck(scope, "CalculatedHealthCheck", {
  childHealthChecks: [healthCheck1, healthCheck2],
});

See for more options API Reference - CalculatedHealthCheckProps

HealthCheck to monitor CloudWatch Alarms

const alarm = cloudwatch.Alarm.fromAlarmArn(
  scope,
  "Alarm",
  "arn:aws:cloudwatch:us-east-1:123456789012:alarm:any-alarm"
);
new AlarmHealthCheck(scope, "HealthCheck", {
  alarm: alarm,
});

See for more options API Reference - AlarmHealthCheckProps

Configuring DNS Failover

An example active-passive DNS failover configuration

DNS failover

Primary

// An alias record set for a CloudFront distribution
const recordSetPrimary = new route53.ARecord(scope, "RecordSetPrimary", {
  recordName: "www.pepperize.com",
  zone: hostedZone,
  target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)),
});
// The health check for the CloudFront distribution
const healthCheckPrimary = new EndpointHealthCheck(scope, "HealthCheckPrimary", {
  domainName: "www.pepperize.com",
});
// Configure the HealthCheckId and Failover on the record set
healthCheckPrimary.failoverPrimary(recordSetPrimary);

Secondary

// An alias record set for an Application Load Balancer
const recordSetSecondary = new route53.ARecord(scope, "RecordSetSecondary", {
  recordName: "www-1.pepperize.com",
  zone: hostedZone,
  target: route53.RecordTarget.fromAlias(new targets.LoadBalancerTarget(alb)),
});
// The health check for the Application Load Balancer
const healthCheckSecondary = new EndpointHealthCheck(scope, "HealthCheckSecondary", {
  domainName: "www-1.pepperize.com",
});
// Configure the HealthCheckId and Failover on the record set
healthCheckSecondary.failoverSecondary(recordSetSecondary, true);

See for more options API Reference - IHealthCheck

How health checks work in complex Amazon Route 53 configurations

API Reference

Constructs

AlarmHealthCheck

Create a Route53 HealthCheck that monitors a CloudWatch Alarm.

Example

const alarm new Alarm(stack, "Alarm", {
   // ...
});
new AlarmHealthCheck(stack, "HealthCheck", {
   alarm: alarm,
});

https://docs.aws.amazon.com/de_de/AWSCloudFormation/latest/UserGuide/aws-resource-route53-healthcheck.html#aws-resource-route53-healthcheck-properties

Initializers

import { AlarmHealthCheck } from '@pepperize/cdk-route53-health-check'

new AlarmHealthCheck(scope: Construct, id: string, props: AlarmHealthCheckProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props AlarmHealthCheckProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
applyRemovalPolicy Apply the given removal policy to this resource.
failover Sets this.healthCheckId as the value for HealthCheckId on the given RecordSet.
failoverPrimary Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.
failoverSecondary Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.
metric Return the given named metric for this HealthCheck.
metricHealthCheckStatus Route53 health checkers report that the HealthCheck is healthy or unhealthy.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
public 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).

policyRequired
  • Type: aws-cdk-lib.RemovalPolicy

failover
public failover(recordSet: RecordSet, evaluateTargetHealth?: boolean, failover?: Failover): void

Sets this.healthCheckId as the value for HealthCheckId on the given RecordSet.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

evaluateTargetHealthOptional
  • Type: boolean

failoverOptional

failoverPrimary
public failoverPrimary(recordSet: RecordSet, evaluateTargetHealth?: boolean): void

Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

evaluateTargetHealthOptional
  • Type: boolean

failoverSecondary
public failoverSecondary(recordSet: RecordSet, evaluateTargetHealth?: boolean): void

Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

evaluateTargetHealthOptional
  • Type: boolean

metric
public metric(metricName: string, props?: MetricOptions): Metric

Return the given named metric for this HealthCheck.

metricNameRequired
  • Type: string

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricHealthCheckStatus
public metricHealthCheckStatus(props?: MetricOptions): Metric

Route53 health checkers report that the HealthCheck is healthy or unhealthy.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

Static Functions

Name Description
isConstruct Checks if x is a construct.
isOwnedResource Returns true if the construct was created by CDK, and false otherwise.
isResource Check whether the given construct is a Resource.
fromHealthCheckId Import an existing Route53 HealthCheck.

isConstruct
import { AlarmHealthCheck } from '@pepperize/cdk-route53-health-check'

AlarmHealthCheck.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


isOwnedResource
import { AlarmHealthCheck } from '@pepperize/cdk-route53-health-check'

AlarmHealthCheck.isOwnedResource(construct: IConstruct)

Returns true if the construct was created by CDK, and false otherwise.

constructRequired
  • Type: constructs.IConstruct

isResource
import { AlarmHealthCheck } from '@pepperize/cdk-route53-health-check'

AlarmHealthCheck.isResource(construct: IConstruct)

Check whether the given construct is a Resource.

constructRequired
  • Type: constructs.IConstruct

fromHealthCheckId
import { AlarmHealthCheck } from '@pepperize/cdk-route53-health-check'

AlarmHealthCheck.fromHealthCheckId(scope: Construct, id: string, healthCheckId: string)

Import an existing Route53 HealthCheck.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

healthCheckIdRequired
  • Type: string

Properties

Name Type Description
node constructs.Node The tree node.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
stack aws-cdk-lib.Stack The stack in which this resource is defined.
healthCheckId string No description.
tags aws-cdk-lib.TagManager TagManager to set, remove and format tags.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


envRequired
public readonly env: ResourceEnvironment;
  • Type: aws-cdk-lib.ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


stackRequired
public readonly stack: Stack;
  • Type: aws-cdk-lib.Stack

The stack in which this resource is defined.


healthCheckIdRequired
public readonly healthCheckId: string;
  • Type: string

tagsRequired
public readonly tags: TagManager;
  • Type: aws-cdk-lib.TagManager

TagManager to set, remove and format tags.


CalculatedHealthCheck

Create a Route53 HealthCheck that monitors other Route53 HealthChecks.

Example

const healthCheck = new EndpointHealthCheck(stack, "HealthCheck", {
   domainName: "pepperize.com",
});
new CalculatedHealthCheck(stack, "CalculatedHealthCheck", {
   childHealthChecks: [healthCheck],
});

https://docs.aws.amazon.com/de_de/AWSCloudFormation/latest/UserGuide/aws-resource-route53-healthcheck.html#aws-resource-route53-healthcheck-properties

Initializers

import { CalculatedHealthCheck } from '@pepperize/cdk-route53-health-check'

new CalculatedHealthCheck(scope: Construct, id: string, props: CalculatedHealthCheckProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props CalculatedHealthCheckProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
applyRemovalPolicy Apply the given removal policy to this resource.
addChildHealthCheck No description.
failover Sets this.healthCheckId as the value for HealthCheckId on the given RecordSet.
failoverPrimary Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.
failoverSecondary Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.
metric Return the given named metric for this HealthCheck.
metricChildHealthCheckHealthyCount The number of ChildHealthChecks that are healthy that Route53 is monitoring.
metricHealthCheckStatus Route53 health checkers report that the HealthCheck is healthy or unhealthy.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
public 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).

policyRequired
  • Type: aws-cdk-lib.RemovalPolicy

addChildHealthCheck
public addChildHealthCheck(healthCheck: IHealthCheck): void
healthCheckRequired

failover
public failover(recordSet: RecordSet, evaluateTargetHealth?: boolean, failover?: Failover): void

Sets this.healthCheckId as the value for HealthCheckId on the given RecordSet.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

evaluateTargetHealthOptional
  • Type: boolean

failoverOptional

failoverPrimary
public failoverPrimary(recordSet: RecordSet, evaluateTargetHealth?: boolean): void

Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

evaluateTargetHealthOptional
  • Type: boolean

failoverSecondary
public failoverSecondary(recordSet: RecordSet, evaluateTargetHealth?: boolean): void

Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

evaluateTargetHealthOptional
  • Type: boolean

metric
public metric(metricName: string, props?: MetricOptions): Metric

Return the given named metric for this HealthCheck.

metricNameRequired
  • Type: string

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricChildHealthCheckHealthyCount
public metricChildHealthCheckHealthyCount(props?: MetricOptions): Metric

The number of ChildHealthChecks that are healthy that Route53 is monitoring.

Valid statistics: Average (recommended), Minimum, Maximum

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricHealthCheckStatus
public metricHealthCheckStatus(props?: MetricOptions): Metric

Route53 health checkers report that the HealthCheck is healthy or unhealthy.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

Static Functions

Name Description
isConstruct Checks if x is a construct.
isOwnedResource Returns true if the construct was created by CDK, and false otherwise.
isResource Check whether the given construct is a Resource.
fromHealthCheckId Import an existing Route53 HealthCheck.

isConstruct
import { CalculatedHealthCheck } from '@pepperize/cdk-route53-health-check'

CalculatedHealthCheck.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


isOwnedResource
import { CalculatedHealthCheck } from '@pepperize/cdk-route53-health-check'

CalculatedHealthCheck.isOwnedResource(construct: IConstruct)

Returns true if the construct was created by CDK, and false otherwise.

constructRequired
  • Type: constructs.IConstruct

isResource
import { CalculatedHealthCheck } from '@pepperize/cdk-route53-health-check'

CalculatedHealthCheck.isResource(construct: IConstruct)

Check whether the given construct is a Resource.

constructRequired
  • Type: constructs.IConstruct

fromHealthCheckId
import { CalculatedHealthCheck } from '@pepperize/cdk-route53-health-check'

CalculatedHealthCheck.fromHealthCheckId(scope: Construct, id: string, healthCheckId: string)

Import an existing Route53 HealthCheck.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

healthCheckIdRequired
  • Type: string

Properties

Name Type Description
node constructs.Node The tree node.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
stack aws-cdk-lib.Stack The stack in which this resource is defined.
healthCheckId string No description.
tags aws-cdk-lib.TagManager TagManager to set, remove and format tags.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


envRequired
public readonly env: ResourceEnvironment;
  • Type: aws-cdk-lib.ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


stackRequired
public readonly stack: Stack;
  • Type: aws-cdk-lib.Stack

The stack in which this resource is defined.


healthCheckIdRequired
public readonly healthCheckId: string;
  • Type: string

tagsRequired
public readonly tags: TagManager;
  • Type: aws-cdk-lib.TagManager

TagManager to set, remove and format tags.


EndpointHealthCheck

Create a Route53 HealthCheck that monitors an endpoint either by domain name or by IP address.

Example

new EndpointHealthCheck(stack, "HealthCheck", {
   domainName: "pepperize.com",
});

Generates

Resources:
   Type: AWS::Route53::HealthCheck
   Properties:
     HealthCheckConfig:
       FullyQualifiedDomainName: "pepperize.com"
       Port: 443
       Type: "HTTPS"
       EnableSNI: true

https://docs.aws.amazon.com/de_de/AWSCloudFormation/latest/UserGuide/aws-resource-route53-healthcheck.html#aws-resource-route53-healthcheck-properties

Initializers

import { EndpointHealthCheck } from '@pepperize/cdk-route53-health-check'

new EndpointHealthCheck(scope: Construct, id: string, props: EndpointHealthCheckProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props EndpointHealthCheckProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
applyRemovalPolicy Apply the given removal policy to this resource.
failover Sets this.healthCheckId as the value for HealthCheckId on the given RecordSet.
failoverPrimary Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.
failoverSecondary Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.
metric Return the given named metric for this HealthCheck.
metricConnectionTime The time in milliseconds that it took Route53 health checkers to establish a TCP connection with the endpoint.
metricHealthCheckPercentageHealthy The percentage of Route53 health checkers that report that the status of the health check is healthy.
metricHealthCheckStatus Route53 health checkers report that the HealthCheck is healthy or unhealthy.
metricSSLHandshakeTime The time in milliseconds that it took Route53 health checkers to complete the SSL/TLS handshake.
metricTimeToFirstByte The time in milliseconds that it took Route53 health checkers to receive the first byte of the response to an HTTP or HTTPS request.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
public 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).

policyRequired
  • Type: aws-cdk-lib.RemovalPolicy

failover
public failover(recordSet: RecordSet, evaluateTargetHealth?: boolean, failover?: Failover): void

Sets this.healthCheckId as the value for HealthCheckId on the given RecordSet.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

evaluateTargetHealthOptional
  • Type: boolean

failoverOptional

failoverPrimary
public failoverPrimary(recordSet: RecordSet, evaluateTargetHealth?: boolean): void

Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

evaluateTargetHealthOptional
  • Type: boolean

failoverSecondary
public failoverSecondary(recordSet: RecordSet, evaluateTargetHealth?: boolean): void

Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

evaluateTargetHealthOptional
  • Type: boolean

metric
public metric(metricName: string, props?: MetricOptions): Metric

Return the given named metric for this HealthCheck.

metricNameRequired
  • Type: string

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricConnectionTime
public metricConnectionTime(props?: MetricOptions): Metric

The time in milliseconds that it took Route53 health checkers to establish a TCP connection with the endpoint.

Valid statistics: Average (recommended), Minimum, Maximum

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricHealthCheckPercentageHealthy
public metricHealthCheckPercentageHealthy(props?: MetricOptions): Metric

The percentage of Route53 health checkers that report that the status of the health check is healthy.

LatencyGraphs has to be enabled

Valid statistics: Average (recommended), Minimum, Maximum

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricHealthCheckStatus
public metricHealthCheckStatus(props?: MetricOptions): Metric

Route53 health checkers report that the HealthCheck is healthy or unhealthy.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricSSLHandshakeTime
public metricSSLHandshakeTime(props?: MetricOptions): Metric

The time in milliseconds that it took Route53 health checkers to complete the SSL/TLS handshake.

Valid statistics: Average, Minimum, Maximum

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricTimeToFirstByte
public metricTimeToFirstByte(props?: MetricOptions): Metric

The time in milliseconds that it took Route53 health checkers to receive the first byte of the response to an HTTP or HTTPS request.

Valid statistics: Average (recommended), Minimum, Maximum

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

Static Functions

Name Description
isConstruct Checks if x is a construct.
isOwnedResource Returns true if the construct was created by CDK, and false otherwise.
isResource Check whether the given construct is a Resource.
fromHealthCheckId Import an existing Route53 HealthCheck.

isConstruct
import { EndpointHealthCheck } from '@pepperize/cdk-route53-health-check'

EndpointHealthCheck.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


isOwnedResource
import { EndpointHealthCheck } from '@pepperize/cdk-route53-health-check'

EndpointHealthCheck.isOwnedResource(construct: IConstruct)

Returns true if the construct was created by CDK, and false otherwise.

constructRequired
  • Type: constructs.IConstruct

isResource
import { EndpointHealthCheck } from '@pepperize/cdk-route53-health-check'

EndpointHealthCheck.isResource(construct: IConstruct)

Check whether the given construct is a Resource.

constructRequired
  • Type: constructs.IConstruct

fromHealthCheckId
import { EndpointHealthCheck } from '@pepperize/cdk-route53-health-check'

EndpointHealthCheck.fromHealthCheckId(scope: Construct, id: string, healthCheckId: string)

Import an existing Route53 HealthCheck.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

healthCheckIdRequired
  • Type: string

Properties

Name Type Description
node constructs.Node The tree node.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
stack aws-cdk-lib.Stack The stack in which this resource is defined.
healthCheckId string No description.
tags aws-cdk-lib.TagManager TagManager to set, remove and format tags.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


envRequired
public readonly env: ResourceEnvironment;
  • Type: aws-cdk-lib.ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


stackRequired
public readonly stack: Stack;
  • Type: aws-cdk-lib.Stack

The stack in which this resource is defined.


healthCheckIdRequired
public readonly healthCheckId: string;
  • Type: string

tagsRequired
public readonly tags: TagManager;
  • Type: aws-cdk-lib.TagManager

TagManager to set, remove and format tags.


Structs

AlarmHealthCheckProps

Initializer

import { AlarmHealthCheckProps } from '@pepperize/cdk-route53-health-check'

const alarmHealthCheckProps: AlarmHealthCheckProps = { ... }

Properties

Name Type Description
alarm aws-cdk-lib.aws_cloudwatch.IAlarm The alarm that Route53 monitors.
healthCheckName string The display name of this Route53 HealthCheck.
insufficientDataHealthStatus InsufficientDataHealthStatus The status to assign to the HealthCheck when CloudWatch has insufficient data about the metric.
inverted boolean Whether to invert the status of the Route53 health check status.

alarmRequired
public readonly alarm: IAlarm;
  • Type: aws-cdk-lib.aws_cloudwatch.IAlarm

The alarm that Route53 monitors.


healthCheckNameOptional
public readonly healthCheckName: string;
  • Type: string

The display name of this Route53 HealthCheck.


insufficientDataHealthStatusOptional
public readonly insufficientDataHealthStatus: InsufficientDataHealthStatus;

The status to assign to the HealthCheck when CloudWatch has insufficient data about the metric.


invertedOptional
public readonly inverted: boolean;
  • Type: boolean

Whether to invert the status of the Route53 health check status.


CalculatedHealthCheckProps

Initializer

import { CalculatedHealthCheckProps } from '@pepperize/cdk-route53-health-check'

const calculatedHealthCheckProps: CalculatedHealthCheckProps = { ... }

Properties

Name Type Description
childHealthChecks IHealthCheck[] The list of HealthCheck that monitors other Route53 HealthChecks.
healthCheckName string The display name of this Route53 HealthCheck.
healthThreshold number The number of child HealthChecks that Amazon Route53 must consider healthy.
inverted boolean Whether to invert the status of the Route53 health check status.

childHealthChecksOptional
public readonly childHealthChecks: IHealthCheck[];

The list of HealthCheck that monitors other Route53 HealthChecks.


healthCheckNameOptional
public readonly healthCheckName: string;
  • Type: string

The display name of this Route53 HealthCheck.


healthThresholdOptional
public readonly healthThreshold: number;
  • Type: number

The number of child HealthChecks that Amazon Route53 must consider healthy.


invertedOptional
public readonly inverted: boolean;
  • Type: boolean

Whether to invert the status of the Route53 health check status.


EndpointHealthCheckProps

Initializer

import { EndpointHealthCheckProps } from '@pepperize/cdk-route53-health-check'

const endpointHealthCheckProps: EndpointHealthCheckProps = { ... }

Properties

Name Type Description
domainName string The domain name that Route53 performs health checks on. Route53 resolves the IP address and performs the lookup.
enableSni boolean Specify that Route53 sends the host name for TLS negotiation.
failureThreshold number The number of consecutive health checks that an endpoint must pass or fail for Route53 to change the current status of the endpoint between healthy and unhealthy.
healthCheckName string The display name of this Route53 HealthCheck.
inverted boolean Whether to invert the status of the Route53 health check status.
ipAddress string The ip address that Route53 performs health checks on. Optionally a domain name may be given.
latencyGraphs boolean Whether Route53 measures the latency between health checkers in multiple AWS regions and your endpoint, and displays a CloudWatch latency graphs in the Route53 console.
port number The port that Route53 performs health checks.
protocol Protocol The protocol that Route53 uses to communicate with the endpoint.
regions HealthCheckerRegions[] The list of regions from which Route53 health checkers check the endpoint.
requestInterval number The number of seconds between the time that Route53 gets a response from your endpoint and the time that it sends the next health check request.
resourcePath string The path for HTTP or HTTPS health checks.
searchString string The search string for HTTP or HTTPS health checks.

domainNameOptional
public readonly domainName: string;
  • Type: string

The domain name that Route53 performs health checks on. Route53 resolves the IP address and performs the lookup.

If IP address is given, it's used as the host name.

Either DomainName or IpAddress must be specified


enableSniOptional
public readonly enableSni: boolean;
  • Type: boolean
  • Default: true for HTTPS

Specify that Route53 sends the host name for TLS negotiation.


failureThresholdOptional
public readonly failureThreshold: number;
  • Type: number

The number of consecutive health checks that an endpoint must pass or fail for Route53 to change the current status of the endpoint between healthy and unhealthy.

Provide a number between 1 and 10.


healthCheckNameOptional
public readonly healthCheckName: string;
  • Type: string

The display name of this Route53 HealthCheck.


invertedOptional
public readonly inverted: boolean;
  • Type: boolean

Whether to invert the status of the Route53 health check status.


ipAddressOptional
public readonly ipAddress: string;
  • Type: string

The ip address that Route53 performs health checks on. Optionally a domain name may be given.

An IP address must be specified if protocol TCP


latencyGraphsOptional
public readonly latencyGraphs: boolean;
  • Type: boolean

Whether Route53 measures the latency between health checkers in multiple AWS regions and your endpoint, and displays a CloudWatch latency graphs in the Route53 console.

Can't be changed after HealthCheck is deployed


portOptional
public readonly port: number;
  • Type: number
  • Default: 80 for HTTP; 443 for HTTPS

The port that Route53 performs health checks.

The port must be between 1 and 65535.


protocolOptional
public readonly protocol: Protocol;

The protocol that Route53 uses to communicate with the endpoint.

An IP address must be specified if protocol TCP


regionsOptional
public readonly regions: HealthCheckerRegions[];

The list of regions from which Route53 health checkers check the endpoint.

If omitted Route53 performs checks from all health checker regions.


requestIntervalOptional
public readonly requestInterval: number;
  • Type: number

The number of seconds between the time that Route53 gets a response from your endpoint and the time that it sends the next health check request.

Each Route53 health checker makes requests at this interval. Provide a number between 10 and 30.

If you choose an interval of 10 and there are 15 health checkers, the endpoint will receive approximately 1 request per second.

Can't be changed after HealthCheck is deployed


resourcePathOptional
public readonly resourcePath: string;
  • Type: string

The path for HTTP or HTTPS health checks.

Provide a string between 1 and 255 length.


searchStringOptional
public readonly searchString: string;
  • Type: string

The search string for HTTP or HTTPS health checks.

Route53 will search in the response body. Provide a string between 1 and 255 length.


Protocols

IHealthCheck

Methods

Name Description
failover Sets this.healthCheckId as the value for HealthCheckId on the given RecordSet.
failoverPrimary Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.
failoverSecondary Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.
metric Return the given named metric for this HealthCheck.
metricHealthCheckStatus Route53 health checkers report that the HealthCheck is healthy or unhealthy.

failover
public failover(recordSet: RecordSet, evaluateTargetHealth?: boolean, failover?: Failover): void

Sets this.healthCheckId as the value for HealthCheckId on the given RecordSet.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget.html#cfn-route53-aliastarget-evaluatetargethealth

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

The Route53 RecordSet to configure failover.


evaluateTargetHealthOptional
  • Type: boolean

Inherit the health of the referenced Alias RecordSet Target.


failoverOptional

Sets PRIMARY or SECONDARY as the value for Failover on the given RecordSet.


failoverPrimary
public failoverPrimary(recordSet: RecordSet, evaluateTargetHealth?: boolean): void

Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget.html#cfn-route53-aliastarget-evaluatetargethealth

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

The Route53 RecordSet to configure failover.


evaluateTargetHealthOptional
  • Type: boolean

Inherit the health of the referenced Alias RecordSet Target.


failoverSecondary
public failoverSecondary(recordSet: RecordSet, evaluateTargetHealth?: boolean): void

Sets PRIMARY as the value for Failover on the given RecordSet. Additionally, sets this.healthCheckId as the value for HealthCheckId.

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource record sets

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget.html#cfn-route53-aliastarget-evaluatetargethealth

recordSetRequired
  • Type: aws-cdk-lib.aws_route53.RecordSet

The Route53 RecordSet to configure failover.


evaluateTargetHealthOptional
  • Type: boolean

Inherit the health of the referenced Alias RecordSet Target.


metric
public metric(metricName: string, props?: MetricOptions): Metric

Return the given named metric for this HealthCheck.

metricNameRequired
  • Type: string

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricHealthCheckStatus
public metricHealthCheckStatus(props?: MetricOptions): Metric

Route53 health checkers report that the HealthCheck is healthy or unhealthy.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

Properties

Name Type Description
healthCheckId string No description.

healthCheckIdRequired
public readonly healthCheckId: string;
  • Type: string

Enums

Failover

Members

Name Description
PRIMARY The primary record set.
SECONDARY The secondary record set.

PRIMARY

The primary record set.


SECONDARY

The secondary record set.


HealthCheckerRegions

The regions of health checker from which Route53 performs checks on the endpoint.

Members

Name Description
US_EAST_1 No description.
US_WEST_1 No description.
US_WEST_2 No description.
EU_WEST_1 No description.
AP_SOUTHEAST_1 No description.
AP_SOUTHEAST_2 No description.
AP_NORTHEAST_1 No description.
SA_EAST_1 No description.

US_EAST_1

US_WEST_1

US_WEST_2

EU_WEST_1

AP_SOUTHEAST_1

AP_SOUTHEAST_2

AP_NORTHEAST_1

SA_EAST_1

InsufficientDataHealthStatus

Members

Name Description
HEALTHY Route53 considers the health check to be healthy.
UNHEALTHY Route53 considers the health check to be unhealthy.
LAST_KNOWN_STATUS Route53 uses the status of the health check from the last time that CloudWatch had sufficient data to determine the alarm state, otherwise healthy.

HEALTHY

Route53 considers the health check to be healthy.


UNHEALTHY

Route53 considers the health check to be unhealthy.


LAST_KNOWN_STATUS

Route53 uses the status of the health check from the last time that CloudWatch had sufficient data to determine the alarm state, otherwise healthy.


Protocol

The protocol that Route53 uses to communicate with the endpoint.

Members

Name Description
HTTP No description.
HTTPS No description.
TCP No description.

HTTP

HTTPS

TCP