Class: AWSCDK::ECS::HealthCheck
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECS::HealthCheck
- Defined in:
- ecs/health_check.rb
Overview
The health check command and associated configuration parameters for the container.
Instance Attribute Summary collapse
-
#command ⇒ Array<String>
readonly
A string array representing the command that the container runs to determine if it is healthy.
-
#interval ⇒ AWSCDK::Duration?
readonly
The time period in seconds between each health check execution.
-
#retries ⇒ Numeric?
readonly
The number of times to retry a failed health check before the container is considered unhealthy.
-
#start_period ⇒ AWSCDK::Duration?
readonly
The optional grace period within which to provide containers time to bootstrap before failed health checks count towards the maximum number of retries.
-
#timeout ⇒ AWSCDK::Duration?
readonly
The time period in seconds to wait for a health check to succeed before it is considered a failure.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(command:, interval: nil, retries: nil, start_period: nil, timeout: nil) ⇒ HealthCheck
constructor
A new instance of HealthCheck.
- #to_jsii ⇒ Object
Constructor Details
#initialize(command:, interval: nil, retries: nil, start_period: nil, timeout: nil) ⇒ HealthCheck
Returns a new instance of HealthCheck.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'ecs/health_check.rb', line 12 def initialize(command:, interval: nil, retries: nil, start_period: nil, timeout: nil) @command = command Jsii::Type.check_type(@command, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "command") @interval = interval Jsii::Type.check_type(@interval, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "interval") unless @interval.nil? @retries = retries Jsii::Type.check_type(@retries, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retries") unless @retries.nil? @start_period = start_period Jsii::Type.check_type(@start_period, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "startPeriod") unless @start_period.nil? @timeout = timeout Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "timeout") unless @timeout.nil? end |
Instance Attribute Details
#command ⇒ Array<String> (readonly)
A string array representing the command that the container runs to determine if it is healthy.
The string array must start with CMD to execute the command arguments directly, or CMD-SHELL to run the command with the container's default shell.
For example: [ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ]
33 34 35 |
# File 'ecs/health_check.rb', line 33 def command @command end |
#interval ⇒ AWSCDK::Duration? (readonly)
Default: Duration.seconds(30)
The time period in seconds between each health check execution.
You may specify between 5 and 300 seconds.
40 41 42 |
# File 'ecs/health_check.rb', line 40 def interval @interval end |
#retries ⇒ Numeric? (readonly)
Default: 3
The number of times to retry a failed health check before the container is considered unhealthy.
You may specify between 1 and 10 retries.
47 48 49 |
# File 'ecs/health_check.rb', line 47 def retries @retries end |
#start_period ⇒ AWSCDK::Duration? (readonly)
Default: No start period
The optional grace period within which to provide containers time to bootstrap before failed health checks count towards the maximum number of retries.
You may specify between 0 and 300 seconds.
54 55 56 |
# File 'ecs/health_check.rb', line 54 def start_period @start_period end |
#timeout ⇒ AWSCDK::Duration? (readonly)
Default: Duration.seconds(5)
The time period in seconds to wait for a health check to succeed before it is considered a failure.
You may specify between 2 and 60 seconds.
61 62 63 |
# File 'ecs/health_check.rb', line 61 def timeout @timeout end |
Class Method Details
.jsii_properties ⇒ Object
63 64 65 66 67 68 69 70 71 |
# File 'ecs/health_check.rb', line 63 def self.jsii_properties { :command => "command", :interval => "interval", :retries => "retries", :start_period => "startPeriod", :timeout => "timeout", } end |
Instance Method Details
#to_jsii ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 |
# File 'ecs/health_check.rb', line 73 def to_jsii result = {} result.merge!({ "command" => @command, "interval" => @interval, "retries" => @retries, "startPeriod" => @start_period, "timeout" => @timeout, }) result.compact end |