AWS::GameLift::ContainerGroupDefinition ContainerHealthCheck - AWS CloudFormation

AWS::GameLift::ContainerGroupDefinition ContainerHealthCheck

Instructions on when and how to check the health of a container in a container fleet. When health check properties are set in a container definition, they override any Docker health checks in the container image. For more information on container health checks, see HealthCheck command in the Amazon Elastic Container Service API.

The following example instructions tell the container to wait 100 seconds after launch before counting failed health checks, then initiate the health check command every 60 seconds. After issuing the health check command, wait 10 seconds for it to succeed. If it fails, retry the command 3 times before considering the container to be unhealthy.

{"Command": [ "CMD-SHELL", "ps cax | grep "processmanager" || exit 1" ], "Interval": 300, "Timeout": 30, "Retries": 5, "StartPeriod": 100 }

Part of: ContainerDefinition$HealthCheck

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Command" : [ String, ... ], "Interval" : Integer, "Retries" : Integer, "StartPeriod" : Integer, "Timeout" : Integer }

YAML

Command: - String Interval: Integer Retries: Integer StartPeriod: Integer Timeout: Integer

Properties

Command

A string array that specifies the command that the container runs to determine if it's healthy.

Required: Yes

Type: Array of String

Minimum: 1 | 1

Maximum: 255 | 20

Update requires: Replacement

Interval

The time period (in seconds) between each health check.

Required: No

Type: Integer

Minimum: 60

Maximum: 300

Update requires: Replacement

Retries

The number of times to retry a failed health check before the container is considered unhealthy. The first run of the command does not count as a retry.

Required: No

Type: Integer

Minimum: 5

Maximum: 10

Update requires: Replacement

StartPeriod

The optional grace period (in seconds) to give a container time to bootstrap before the first failed health check counts toward the number of retries.

Required: No

Type: Integer

Minimum: 0

Maximum: 300

Update requires: Replacement

Timeout

The time period (in seconds) to wait for a health check to succeed before a failed health check is counted.

Required: No

Type: Integer

Minimum: 30

Maximum: 60

Update requires: Replacement