Skip to content
v2.277.0

HealthCheck Class ​

Health check settings.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';
const healthCheck = autoscaling.HealthCheck.ec2(/* all optional props */ {
  grace: cdk.Duration.minutes(30),
});
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_autoscaling as autoscaling

health_check = autoscaling.HealthCheck.ec2(
    grace=cdk.Duration.minutes(30)
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.autoscaling.*;

HealthCheck healthCheck = HealthCheck.ec2(Ec2HealthCheckOptions.builder()
        .grace(Duration.minutes(30))
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.AutoScaling;

var healthCheck = HealthCheck.Ec2(new Ec2HealthCheckOptions {
    Grace = Duration.Minutes(30)
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

healthCheck := awscdk.Aws_autoscaling.HealthCheck_Ec2(&Ec2HealthCheckOptions{
	Grace: cdk.Duration_Minutes(jsii.Number(30)),
})

Properties ​

gracePeriodmay be undefinedDurationgrace_periodmay be undefinedDurationgracePeriodmay be undefinedDurationGracePeriodmay be undefinedDurationGracePeriodmay be undefinedDuration#
typestringtypestrtypeStringTypestringType*string#

Methods ​

ec2(options?: Ec2HealthCheckOptions): HealthCheck // chainable@staticmethod def ec2(options: typing.Optional[Ec2HealthCheckOptions] = None) -> HealthCheckpublic static HealthCheck ec2(Ec2HealthCheckOptions options)public static HealthCheck Ec2(Ec2HealthCheckOptions? options = null)func Ec2(Options Ec2HealthCheckOptions) HealthCheckstatic#
Use EC2 for health checks.
1 parameter

Parameters

  • optionsoptionsoptionsoptionsOptions — EC2 health check options.
elb(options: ElbHealthCheckOptions): HealthCheck // chainable@staticmethod def elb(options: ElbHealthCheckOptions) -> HealthCheckpublic static HealthCheck elb(ElbHealthCheckOptions options)public static HealthCheck Elb(ElbHealthCheckOptions options)func Elb(Options ElbHealthCheckOptions) HealthCheckstatic#
Use ELB for health checks.

It considers the instance unhealthy if it fails either the EC2 status checks or the load balancer health checks.

1 parameter

Parameters

  • optionsoptionsoptionsoptionsOptions — ELB health check options.