Class: AWSCDK::ElasticLoadBalancing::HealthCheck
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ElasticLoadBalancing::HealthCheck
- Defined in:
- elastic_load_balancing/health_check.rb
Overview
Describe the health check to a load balancer.
Instance Attribute Summary collapse
-
#healthy_threshold ⇒ Numeric?
readonly
After how many successful checks is an instance considered healthy.
-
#interval ⇒ AWSCDK::Duration?
readonly
Number of seconds between health checks.
-
#path ⇒ String?
readonly
What path to use for HTTP or HTTPS health check (must return 200).
-
#port ⇒ Numeric
readonly
What port number to health check on.
-
#protocol ⇒ AWSCDK::ElasticLoadBalancing::LoadBalancingProtocol?
readonly
What protocol to use for health checking.
-
#timeout ⇒ AWSCDK::Duration?
readonly
Health check timeout.
-
#unhealthy_threshold ⇒ Numeric?
readonly
After how many unsuccessful checks is an instance considered unhealthy.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(port:, healthy_threshold: nil, interval: nil, path: nil, protocol: nil, timeout: nil, unhealthy_threshold: nil) ⇒ HealthCheck
constructor
A new instance of HealthCheck.
- #to_jsii ⇒ Object
Constructor Details
#initialize(port:, healthy_threshold: nil, interval: nil, path: nil, protocol: nil, timeout: nil, unhealthy_threshold: nil) ⇒ HealthCheck
Returns a new instance of HealthCheck.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'elastic_load_balancing/health_check.rb', line 14 def initialize(port:, healthy_threshold: nil, interval: nil, path: nil, protocol: nil, timeout: nil, unhealthy_threshold: nil) @port = port Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port") @healthy_threshold = healthy_threshold Jsii::Type.check_type(@healthy_threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "healthyThreshold") unless @healthy_threshold.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? @protocol = protocol Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmcuTG9hZEJhbGFuY2luZ1Byb3RvY29sIn0=")), "protocol") unless @protocol.nil? @timeout = timeout Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "timeout") unless @timeout.nil? @unhealthy_threshold = unhealthy_threshold Jsii::Type.check_type(@unhealthy_threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "unhealthyThreshold") unless @unhealthy_threshold.nil? end |
Instance Attribute Details
#healthy_threshold ⇒ Numeric? (readonly)
Default: 2
After how many successful checks is an instance considered healthy.
39 40 41 |
# File 'elastic_load_balancing/health_check.rb', line 39 def healthy_threshold @healthy_threshold end |
#interval ⇒ AWSCDK::Duration? (readonly)
Default: Duration.seconds(30)
Number of seconds between health checks.
44 45 46 |
# File 'elastic_load_balancing/health_check.rb', line 44 def interval @interval end |
#path ⇒ String? (readonly)
Default: "/"
What path to use for HTTP or HTTPS health check (must return 200).
For SSL and TCP health checks, accepting connections is enough to be considered healthy.
52 53 54 |
# File 'elastic_load_balancing/health_check.rb', line 52 def path @path end |
#port ⇒ Numeric (readonly)
What port number to health check on.
34 35 36 |
# File 'elastic_load_balancing/health_check.rb', line 34 def port @port end |
#protocol ⇒ AWSCDK::ElasticLoadBalancing::LoadBalancingProtocol? (readonly)
Default: Automatic
What protocol to use for health checking.
The protocol is automatically determined from the port if it's not supplied.
59 60 61 |
# File 'elastic_load_balancing/health_check.rb', line 59 def protocol @protocol end |
#timeout ⇒ AWSCDK::Duration? (readonly)
Default: Duration.seconds(5)
Health check timeout.
64 65 66 |
# File 'elastic_load_balancing/health_check.rb', line 64 def timeout @timeout end |
#unhealthy_threshold ⇒ Numeric? (readonly)
Default: 5
After how many unsuccessful checks is an instance considered unhealthy.
69 70 71 |
# File 'elastic_load_balancing/health_check.rb', line 69 def unhealthy_threshold @unhealthy_threshold end |
Class Method Details
.jsii_properties ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 |
# File 'elastic_load_balancing/health_check.rb', line 71 def self.jsii_properties { :port => "port", :healthy_threshold => "healthyThreshold", :interval => "interval", :path => "path", :protocol => "protocol", :timeout => "timeout", :unhealthy_threshold => "unhealthyThreshold", } end |
Instance Method Details
#to_jsii ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'elastic_load_balancing/health_check.rb', line 83 def to_jsii result = {} result.merge!({ "port" => @port, "healthyThreshold" => @healthy_threshold, "interval" => @interval, "path" => @path, "protocol" => @protocol, "timeout" => @timeout, "unhealthyThreshold" => @unhealthy_threshold, }) result.compact end |