Skip to content

HealthCheckTemplate

This class encapsulates and extends the ROS resource type ALIYUN::ALB::HealthCheckTemplate, which is used to create a health check template.

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)
//  .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)
//  .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 code for 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 that is used for health checks.
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 HTTP method that is used for health checks.
healthCheckPath java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property healthCheckPath: The URL path that is used for health checks.
healthCheckProtocol java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property healthCheckProtocol: The protocol that is used for health checks.
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.
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, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.


healthCheckCodesOptional

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

Property healthCheckCodes: The HTTP status code for a successful health check.

If HealthCheckProtocol is set to HTTP, HealthCheckCodes can be set to http_2xx (default), http_3xx, http_4xx, and http_5xx. Separate multiple HTTP status codes with commas (,). If HealthCheckProtocol is set to gRPC, HealthCheckCodes can be set to 0 to 99. Default value: 0. Value ranges are supported. You can enter at most 20 value ranges and must separate them with commas (,). Note This parameter is required only if the HealthCheckProtocol parameter is set to HTTP.


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 that is used for health checks.

Default value: $SERVER_IP. The domain name is 1 to 80 characters in length. Make sure that the destination CIDR block meets the following requirements: The domain name can contain lowercase letters, digits, hyphens (-), and periods (.). The domain name contains at least one period (.) but does not start or end with a period (.). The rightmost domain label can contain only letters, and cannot contain digits or hyphens (-). Other domain labels cannot start or end with a hyphen (-). This parameter is required only if the HealthCheckProtocol parameter is set to HTTP.


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 HTTP method that is used for health checks.

Valid values: HEAD: By default, the ALB instance sends HEAD requests to a backend server to perform HTTP health checks. POST: By default, gRPC health checks use the POST method. GET: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected. Note This parameter is required only if the HealthCheckProtocol parameter is set to HTTP.


healthCheckPathOptional

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

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

It must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). It can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +. The URL path must start with a forward slash (/). Note This parameter is required only if the HealthCheckProtocol parameter is set to HTTP.


healthCheckProtocolOptional

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

Property healthCheckProtocol: The protocol that is used for health checks.

Valid values: HTTP: The ALB instance sends HEAD or GET requests to a backend server to simulate access from a browser and check whether the backend server is healthy. This is the default protocol. TCP: To perform TCP health checks, ALB sends SYN packets to a backend server to check whether the port of the backend server is available to receive requests. GRPC: To perform gRPC health checks, ALB sends POST or GET requests to a backend server to check whether the backend server is healthy.


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.


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.
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

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.
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 com.aliyun.ros.cdk.core.IResolvable Attribute HealthCheckTemplateId: The ID of the health check template.

nodeRequired

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

The construct tree node associated with this construct.


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 IResolvable getAttrHealthCheckTemplateId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute HealthCheckTemplateId: The ID of the health check template.