Class: AWSCDK::ElasticLoadBalancing::HealthCheck

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
elastic_load_balancing/health_check.rb

Overview

Describe the health check to a load balancer.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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.

Parameters:

  • port (Numeric)

    What port number to health check on.

  • healthy_threshold (Numeric, nil) (defaults to: nil)

    After how many successful checks is an instance considered healthy.

  • interval (AWSCDK::Duration, nil) (defaults to: nil)

    Number of seconds between health checks.

  • path (String, nil) (defaults to: nil)

    What path to use for HTTP or HTTPS health check (must return 200).

  • protocol (AWSCDK::ElasticLoadBalancing::LoadBalancingProtocol, nil) (defaults to: nil)

    What protocol to use for health checking.

  • timeout (AWSCDK::Duration, nil) (defaults to: nil)

    Health check timeout.

  • unhealthy_threshold (Numeric, nil) (defaults to: nil)

    After how many unsuccessful checks is an instance considered unhealthy.



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_thresholdNumeric? (readonly)

Note:

Default: 2

After how many successful checks is an instance considered healthy.

Returns:

  • (Numeric, nil)


39
40
41
# File 'elastic_load_balancing/health_check.rb', line 39

def healthy_threshold
  @healthy_threshold
end

#intervalAWSCDK::Duration? (readonly)

Note:

Default: Duration.seconds(30)

Number of seconds between health checks.

Returns:



44
45
46
# File 'elastic_load_balancing/health_check.rb', line 44

def interval
  @interval
end

#pathString? (readonly)

Note:

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.

Returns:

  • (String, nil)


52
53
54
# File 'elastic_load_balancing/health_check.rb', line 52

def path
  @path
end

#portNumeric (readonly)

What port number to health check on.

Returns:

  • (Numeric)


34
35
36
# File 'elastic_load_balancing/health_check.rb', line 34

def port
  @port
end

#protocolAWSCDK::ElasticLoadBalancing::LoadBalancingProtocol? (readonly)

Note:

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

#timeoutAWSCDK::Duration? (readonly)

Note:

Default: Duration.seconds(5)

Health check timeout.

Returns:



64
65
66
# File 'elastic_load_balancing/health_check.rb', line 64

def timeout
  @timeout
end

#unhealthy_thresholdNumeric? (readonly)

Note:

Default: 5

After how many unsuccessful checks is an instance considered unhealthy.

Returns:

  • (Numeric, nil)


69
70
71
# File 'elastic_load_balancing/health_check.rb', line 69

def unhealthy_threshold
  @unhealthy_threshold
end

Class Method Details

.jsii_propertiesObject



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_jsiiObject



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