Skip to content
v2.274.0

HealthCheck Class ​

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

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()
python
HealthCheck()
java
new HealthCheck()
csharp
new HealthCheck()
go
NewHealthCheck()

Methods ​

bind(scope: Construct, options: HealthCheckBindOptions): HealthCheckConfigdef bind(self, scope: Construct, options: HealthCheckBindOptions) -> HealthCheckConfigpublic HealthCheckConfig bind(Construct scope, HealthCheckBindOptions options)public HealthCheckConfig Bind(Construct scope, HealthCheckBindOptions options)func 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@staticmethod def grpc(options: typing.Optional[GrpcHealthCheckOptions] = None) -> HealthCheckpublic static HealthCheck grpc(GrpcHealthCheckOptions options)public static HealthCheck Grpc(GrpcHealthCheckOptions? options = null)func Grpc(Options GrpcHealthCheckOptions) HealthCheckstatic#
Construct a GRPC health check.
http(options?: HttpHealthCheckOptions): HealthCheck // chainable@staticmethod def http(options: typing.Optional[HttpHealthCheckOptions] = None) -> HealthCheckpublic static HealthCheck http(HttpHealthCheckOptions options)public static HealthCheck Http(HttpHealthCheckOptions? options = null)func Http(Options HttpHealthCheckOptions) HealthCheckstatic#
Construct a HTTP health check.
http2(options?: HttpHealthCheckOptions): HealthCheck // chainable@staticmethod def http2(options: typing.Optional[HttpHealthCheckOptions] = None) -> HealthCheckpublic static HealthCheck http2(HttpHealthCheckOptions options)public static HealthCheck Http2(HttpHealthCheckOptions? options = null)func Http2(Options HttpHealthCheckOptions) HealthCheckstatic#
Construct a HTTP2 health check.
tcp(options?: TcpHealthCheckOptions): HealthCheck // chainable@staticmethod def tcp(options: typing.Optional[TcpHealthCheckOptions] = None) -> HealthCheckpublic static HealthCheck tcp(TcpHealthCheckOptions options)public static HealthCheck Tcp(TcpHealthCheckOptions? options = null)func Tcp(Options TcpHealthCheckOptions) HealthCheckstatic#
Construct a TCP health check.