Skip to content

HealthCheckTemplate

This class encapsulates and extends the ROS resource type ALIYUN::ALB::HealthCheckTemplate.

Initializers

import com.aliyun.ros.cdk.alb.HealthCheckTemplate;
HealthCheckTemplate.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
    .healthCheckTemplateName(java.lang.String)
    .healthCheckTemplateName(IResolvable)
//  .healthCheckCodes(IResolvable)
//  .healthCheckCodes(java.util.List<java.lang.String)
//  .healthCheckCodes(IResolvable>)
//  .healthCheckConnectPort(java.lang.Number)
//  .healthCheckConnectPort(IResolvable)
//  .healthCheckHost(java.lang.String)
//  .healthCheckHost(IResolvable)
//  .healthCheckHttpVersion(java.lang.String)
//  .healthCheckHttpVersion(IResolvable)
//  .healthCheckInterval(java.lang.Number)
//  .healthCheckInterval(IResolvable)
//  .healthCheckMethod(java.lang.String)
//  .healthCheckMethod(IResolvable)
//  .healthCheckPath(java.lang.String)
//  .healthCheckPath(IResolvable)
//  .healthCheckProtocol(java.lang.String)
//  .healthCheckProtocol(IResolvable)
//  .healthCheckTimeout(java.lang.Number)
//  .healthCheckTimeout(IResolvable)
//  .healthyThreshold(java.lang.Number)
//  .healthyThreshold(IResolvable)
//  .resourceGroupId(java.lang.String)
//  .resourceGroupId(IResolvable)
//  .unhealthyThreshold(java.lang.Number)
//  .unhealthyThreshold(IResolvable)
    .build();
Name Type Description
scope com.aliyun.ros.cdk.core.Construct No description.
id java.lang.String No description.
enableResourcePropertyConstraint java.lang.Boolean No description.
healthCheckTemplateName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property healthCheckTemplateName: The name of the health check template.
healthCheckCodes com.aliyun.ros.cdk.core.IResolvable OR java.util.List Property healthCheckCodes: The HTTP status codes that indicate a successful health check.
healthCheckConnectPort java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property healthCheckConnectPort: The port that is used for health checks.
healthCheckHost java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property healthCheckHost: The domain name used for the health check.
healthCheckHttpVersion java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property healthCheckHttpVersion: The HTTP version for health check protocol.
healthCheckInterval java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property healthCheckInterval: The interval between two consecutive health checks.
healthCheckMethod java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property healthCheckMethod: The method used for the health check.
healthCheckPath java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property healthCheckPath: The URL that is used for health checks.
healthCheckProtocol java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property healthCheckProtocol: The protocol used for the health check.
healthCheckTimeout java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property healthCheckTimeout: The timeout period of a health check.
healthyThreshold java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property healthyThreshold: The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy.
resourceGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property resourceGroupId: The ID of the resource group.
unhealthyThreshold java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property unhealthyThreshold: The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy.

scopeRequired

  • Type: com.aliyun.ros.cdk.core.Construct

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

healthCheckTemplateNameRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property healthCheckTemplateName: The name of the health check template.

The name must be 2 to 128 characters in length, must start with a letter, a digit, or a Chinese character, and can contain digits, periods (.), underscores (_), hyphens (-), and spaces.


healthCheckCodesOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List

Property healthCheckCodes: The HTTP status codes that indicate a successful health check.


healthCheckConnectPortOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property healthCheckConnectPort: The port that is used for health checks.

Valid values: 0 to 65535. Default value: 0. This value indicates that the port on a backend server is used for health checks.


healthCheckHostOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property healthCheckHost: The domain name used for the health check.

Valid values:

  • $SERVER_IP: The private IP address of a backend server. If you set this parameter to $SERVER_IP or leave it empty, the load balancer uses the private IP address of the backend server as the domain name for the health check.
  • domain: The domain name must be 1 to 80 characters in length and can contain letters, digits, periods (.), and hyphens (-).

This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or HTTPS.


healthCheckHttpVersionOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property healthCheckHttpVersion: The HTTP version for health check protocol.

Valid values: HTTP1.0 or HTTP1.1. Default value: HTTP 1.1. This parameter is available only when HealthCheckProtocol is set to HTTP or HTTPS.


healthCheckIntervalOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property healthCheckInterval: The interval between two consecutive health checks.

Unit: seconds. Valid values: 1 to 50. Default value: 2.


healthCheckMethodOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property healthCheckMethod: The method used for the health check.

Valid values:

  • HEAD (default): For HTTP and HTTPS listeners, the default health check method is HEAD.
  • POST: For gRPC listeners, the default health check method is POST.
  • GET: If the response body exceeds 8 KB, it is truncated. This does not affect the health check result.

This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP, HTTPS, or gRPC.


healthCheckPathOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property healthCheckPath: The URL that is used for health checks.

The URL must be 1 to 80 characters in length. It must start with a forward slash (/) and can contain letters, digits, and the following special characters: - \/ . % ? # & _;~!()*[]@$^:',+.

This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or HTTPS.


healthCheckProtocolOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property healthCheckProtocol: The protocol used for the health check.

Valid values:

  • HTTP (default): simulates browser access by sending HEAD or GET requests to check whether the server application is healthy.
  • HTTPS: simulates browser access by sending HEAD or GET requests to check whether the server application is healthy. HTTPS provides encrypted data transmission and is more secure than HTTP.
  • TCP: checks whether the server port is responsive by sending SYN packets.
  • gRPC: checks whether the server application is healthy by sending POST or GET requests.

healthCheckTimeoutOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property healthCheckTimeout: The timeout period of a health check.

Unit: seconds. If a backend server does not respond within the specified timeout period, the backend server fails the health check. Valid values: 1 to 300. Default value: 5. Note If the value of the HealthCheckTimeout parameter is smaller than that of the HealthCheckInterval parameter, the timeout period specified by the HealthCheckTimeout parameter is ignored and the value of the HealthCheckInterval parameter is used as the timeout period.


healthyThresholdOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property healthyThreshold: The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy.

In this case, the health status is changed from fail to success. Valid values: 2 to 10. Default value: 3.


resourceGroupIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property resourceGroupId: The ID of the resource group.


unhealthyThresholdOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property unhealthyThreshold: The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy.

In this case, the health status is changed from success to fail. Valid values: 2 to 10. Default value: 3.


Methods

Name Description
toString Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
addCondition No description.
addCount No description.
addDependency No description.
addResourceDesc No description.
applyRemovalPolicy No description.
fetchCondition No description.
fetchDependency No description.
fetchResourceDesc No description.
getAtt No description.
setMetadata No description.

toString

public java.lang.String toString()

Returns a string representation of this construct.

synthesize

public void synthesize(ISynthesisSession session)

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

fetchCondition

public RosCondition fetchCondition()

fetchDependency

public java.util.List<java.lang.String> fetchDependency()

fetchResourceDesc

public java.lang.String fetchResourceDesc()

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • Type: java.lang.Object

Static Functions

Name Description
isConstruct Return whether the given object is a Construct.

isConstruct

import com.aliyun.ros.cdk.alb.HealthCheckTemplate;
HealthCheckTemplate.isConstruct(java.lang.Object x)

Return whether the given object is a Construct.

xRequired

  • Type: java.lang.Object

Properties

Name Type Description
node com.aliyun.ros.cdk.core.ConstructNode The construct tree node associated with this construct.
env com.aliyun.ros.cdk.core.IResourceEnvironment The environment this resource belongs to.
ref java.lang.String No description.
stack com.aliyun.ros.cdk.core.Stack The stack in which this resource is defined.
resource com.aliyun.ros.cdk.core.RosResource No description.
attrHealthCheckTemplateId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute HealthCheckTemplateId: The ID of the health check template.
props HealthCheckTemplateProps No description.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


envRequired

public IResourceEnvironment getEnv();
  • Type: com.aliyun.ros.cdk.core.IResourceEnvironment

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.


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

stackRequired

public Stack getStack();
  • Type: com.aliyun.ros.cdk.core.Stack

The stack in which this resource is defined.


resourceOptional

public RosResource getResource();
  • Type: com.aliyun.ros.cdk.core.RosResource

attrHealthCheckTemplateIdRequired

public java.lang.Object getAttrHealthCheckTemplateId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute HealthCheckTemplateId: The ID of the health check template.


propsRequired

public HealthCheckTemplateProps getProps();