class HealthCheck
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppMesh.HealthCheck |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsappmesh#HealthCheck |
Java | software.amazon.awscdk.services.appmesh.HealthCheck |
Python | aws_cdk.aws_appmesh.HealthCheck |
TypeScript (source) | aws-cdk-lib » aws_appmesh » HealthCheck |
Contains static factory methods for creating health checks for different protocols.
Example
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
new HealthCheck()
Methods
Name | Description |
---|---|
bind(scope, options) | Called when the AccessLog type is initialized. |
static grpc(options?) | Construct a GRPC health check. |
static http(options?) | Construct a HTTP health check. |
static http2(options?) | Construct a HTTP2 health check. |
static tcp(options?) | Construct a TCP health check. |
bind(scope, options)
public bind(scope: Construct, options: HealthCheckBindOptions): HealthCheckConfig
Parameters
- scope
Construct
- options
Health
Check Bind Options
Returns
Called when the AccessLog type is initialized.
Can be used to enforce mutual exclusivity with future properties
static grpc(options?)
public static grpc(options?: GrpcHealthCheckOptions): HealthCheck
Parameters
- options
Grpc
Health Check Options
Returns
Construct a GRPC health check.
static http(options?)
public static http(options?: HttpHealthCheckOptions): HealthCheck
Parameters
- options
Http
Health Check Options
Returns
Construct a HTTP health check.
static http2(options?)
public static http2(options?: HttpHealthCheckOptions): HealthCheck
Parameters
- options
Http
Health Check Options
Returns
Construct a HTTP2 health check.
static tcp(options?)
public static tcp(options?: TcpHealthCheckOptions): HealthCheck
Parameters
- options
Tcp
Health Check Options
Returns
Construct a TCP health check.