Class: AWSCDK::ElasticLoadBalancingv2::HealthCheck
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ElasticLoadBalancingv2::HealthCheck
- Defined in:
- elastic_load_balancingv2/health_check.rb
Overview
Properties for configuring a health check.
Instance Attribute Summary collapse
-
#enabled ⇒ Boolean?
readonly
Indicates whether health checks are enabled.
-
#healthy_grpc_codes ⇒ String?
readonly
GRPC code to use when checking for a successful response from a target.
-
#healthy_http_codes ⇒ String?
readonly
HTTP code to use when checking for a successful response from a target.
-
#healthy_threshold_count ⇒ Numeric?
readonly
The number of consecutive health checks successes required before considering an unhealthy target healthy.
-
#interval ⇒ AWSCDK::Duration?
readonly
The approximate number of seconds between health checks for an individual target.
-
#path ⇒ String?
readonly
The ping path destination where Elastic Load Balancing sends health check requests.
-
#port ⇒ String?
readonly
The port that the load balancer uses when performing health checks on the targets.
-
#protocol ⇒ AWSCDK::ElasticLoadBalancingv2::Protocol?
readonly
The protocol the load balancer uses when performing health checks on targets.
-
#timeout ⇒ AWSCDK::Duration?
readonly
The amount of time, in seconds, during which no response from a target means a failed health check.
-
#unhealthy_threshold_count ⇒ Numeric?
readonly
The number of consecutive health check failures required before considering a target unhealthy.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(enabled: nil, healthy_grpc_codes: nil, healthy_http_codes: nil, healthy_threshold_count: nil, interval: nil, path: nil, port: nil, protocol: nil, timeout: nil, unhealthy_threshold_count: nil) ⇒ HealthCheck
constructor
A new instance of HealthCheck.
- #to_jsii ⇒ Object
Constructor Details
#initialize(enabled: nil, healthy_grpc_codes: nil, healthy_http_codes: nil, healthy_threshold_count: nil, interval: nil, path: nil, port: nil, protocol: nil, timeout: nil, unhealthy_threshold_count: nil) ⇒ HealthCheck
Returns a new instance of HealthCheck.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'elastic_load_balancingv2/health_check.rb', line 17 def initialize(enabled: nil, healthy_grpc_codes: nil, healthy_http_codes: nil, healthy_threshold_count: nil, interval: nil, path: nil, port: nil, protocol: nil, timeout: nil, unhealthy_threshold_count: nil) @enabled = enabled Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil? @healthy_grpc_codes = healthy_grpc_codes Jsii::Type.check_type(@healthy_grpc_codes, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "healthyGrpcCodes") unless @healthy_grpc_codes.nil? @healthy_http_codes = healthy_http_codes Jsii::Type.check_type(@healthy_http_codes, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "healthyHttpCodes") unless @healthy_http_codes.nil? @healthy_threshold_count = healthy_threshold_count Jsii::Type.check_type(@healthy_threshold_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "healthyThresholdCount") unless @healthy_threshold_count.nil? @interval = interval Jsii::Type.check_type(@interval, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "interval") unless @interval.nil? @path = path Jsii::Type.check_type(@path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") unless @path.nil? @port = port Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "port") unless @port.nil? @protocol = protocol Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5Qcm90b2NvbCJ9")), "protocol") unless @protocol.nil? @timeout = timeout Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "timeout") unless @timeout.nil? @unhealthy_threshold_count = unhealthy_threshold_count Jsii::Type.check_type(@unhealthy_threshold_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "unhealthyThresholdCount") unless @unhealthy_threshold_count.nil? end |
Instance Attribute Details
#enabled ⇒ Boolean? (readonly)
Default: - Determined automatically.
Indicates whether health checks are enabled.
If the target type is lambda, health checks are disabled by default but can be enabled. If the target type is instance or ip, health checks are always enabled and cannot be disabled.
48 49 50 |
# File 'elastic_load_balancingv2/health_check.rb', line 48 def enabled @enabled end |
#healthy_grpc_codes ⇒ String? (readonly)
Default: 12
GRPC code to use when checking for a successful response from a target.
You can specify values between 0 and 99. You can specify multiple values (for example, "0,1") or a range of values (for example, "0-5").
56 57 58 |
# File 'elastic_load_balancingv2/health_check.rb', line 56 def healthy_grpc_codes @healthy_grpc_codes end |
#healthy_http_codes ⇒ String? (readonly)
HTTP code to use when checking for a successful response from a target.
For Application Load Balancers, you can specify values between 200 and 499, and the default value is 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").
64 65 66 |
# File 'elastic_load_balancingv2/health_check.rb', line 64 def healthy_http_codes @healthy_http_codes end |
#healthy_threshold_count ⇒ Numeric? (readonly)
Default: - 5 for ALBs, 3 for NLBs
The number of consecutive health checks successes required before considering an unhealthy target healthy.
For Application Load Balancers, the default is 5. For Network Load Balancers, the default is 3.
71 72 73 |
# File 'elastic_load_balancingv2/health_check.rb', line 71 def healthy_threshold_count @healthy_threshold_count end |
#interval ⇒ AWSCDK::Duration? (readonly)
Default: - 10 seconds if protocol is GENEVE, 35 seconds if target type is lambda, else 30 seconds
The approximate number of seconds between health checks for an individual target.
Must be 5 to 300 seconds
78 79 80 |
# File 'elastic_load_balancingv2/health_check.rb', line 78 def interval @interval end |
#path ⇒ String? (readonly)
Default: /
The ping path destination where Elastic Load Balancing sends health check requests.
83 84 85 |
# File 'elastic_load_balancingv2/health_check.rb', line 83 def path @path end |
#port ⇒ String? (readonly)
Default: 'traffic-port'
The port that the load balancer uses when performing health checks on the targets.
88 89 90 |
# File 'elastic_load_balancingv2/health_check.rb', line 88 def port @port end |
#protocol ⇒ AWSCDK::ElasticLoadBalancingv2::Protocol? (readonly)
Default: - HTTP for ALBs, TCP for NLBs
The protocol the load balancer uses when performing health checks on targets.
The TCP protocol is supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The TLS, UDP, and TCP_UDP protocols are not supported for health checks.
96 97 98 |
# File 'elastic_load_balancingv2/health_check.rb', line 96 def protocol @protocol end |
#timeout ⇒ AWSCDK::Duration? (readonly)
Default: - 6 seconds if the protocol is HTTP, 5 seconds if protocol is GENEVE, 30 seconds if target type is lambda, 10 seconds for TCP, TLS, or HTTPS
The amount of time, in seconds, during which no response from a target means a failed health check.
Must be 2 to 120 seconds.
103 104 105 |
# File 'elastic_load_balancingv2/health_check.rb', line 103 def timeout @timeout end |
#unhealthy_threshold_count ⇒ Numeric? (readonly)
Default: 2
The number of consecutive health check failures required before considering a target unhealthy.
For Application Load Balancers, the default is 2. For Network Load Balancers, the range is between 2-10 and can be set accordingly.
111 112 113 |
# File 'elastic_load_balancingv2/health_check.rb', line 111 def unhealthy_threshold_count @unhealthy_threshold_count end |
Class Method Details
.jsii_properties ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'elastic_load_balancingv2/health_check.rb', line 113 def self.jsii_properties { :enabled => "enabled", :healthy_grpc_codes => "healthyGrpcCodes", :healthy_http_codes => "healthyHttpCodes", :healthy_threshold_count => "healthyThresholdCount", :interval => "interval", :path => "path", :port => "port", :protocol => "protocol", :timeout => "timeout", :unhealthy_threshold_count => "unhealthyThresholdCount", } end |
Instance Method Details
#to_jsii ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'elastic_load_balancingv2/health_check.rb', line 128 def to_jsii result = {} result.merge!({ "enabled" => @enabled, "healthyGrpcCodes" => @healthy_grpc_codes, "healthyHttpCodes" => @healthy_http_codes, "healthyThresholdCount" => @healthy_threshold_count, "interval" => @interval, "path" => @path, "port" => @port, "protocol" => @protocol, "timeout" => @timeout, "unhealthyThresholdCount" => @unhealthy_threshold_count, }) result.compact end |