Skip to content

Commit

Permalink
ecs_taskdefinition - add health check documentation (ansible-collecti…
Browse files Browse the repository at this point in the history
…ons#1610)

ecs_taskdefinition - add health check documentation

SUMMARY

Adds documentation for the healthCheck dict for ecs_taskdefinition.

Fixes ansible-collections#1565
ISSUE TYPE


Docs Pull Request

COMPONENT NAME

plugins/modules/ecs_taskdefinition.py
ADDITIONAL INFORMATION

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Alina Buzachis <None>
  • Loading branch information
aschereT authored and abikouo committed Sep 18, 2023
1 parent e8da9b4 commit 8f524f8
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions ecs_taskdefinition.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,49 @@
description: The health check command and associated configuration parameters for the container.
required: False
type: dict
suboptions:
command:
description:
- A string array representing the command that the container runs to determine if it is healthy.
- >
The string array must start with CMD to run the command arguments directly,
or CMD-SHELL to run the command with the container's default shell.
- An exit code of 0 indicates success, and non-zero exit code indicates failure.
required: False
type: list
elements: str
interval:
description:
- The time period in seconds between each health check execution.
- You may specify between 5 and 300 seconds. The default value is 30 seconds.
required: False
type: int
default: 30
retries:
description:
- The number of times to retry a failed health check before the container is considered unhealthy.
- You may specify between 1 and 10 retries. The default value is 3.
required: False
type: int
default: 3
startPeriod:
description:
- >
The optional grace period to provide containers time to bootstrap
before failed health checks count towards the maximum number of retries.
- You can specify between 0 and 300 seconds. By default, the startPeriod is disabled.
- >
Note: If a health check succeeds within the startPeriod,
then the container is considered healthy and any subsequent failures count toward the maximum number of retries.
required: False
type: int
timeout:
description:
- 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. The default value is 5.
required: False
type: int
default: 5
systemControls:
description: A list of namespaced kernel parameters to set in the container.
required: False
Expand Down Expand Up @@ -677,6 +720,29 @@
memory: 1GB
state: present
network_mode: awsvpc
# Create Task Definition with health check
- name: Create task definition
community.aws.ecs_taskdefinition:
family: nginx
containers:
- name: nginx
essential: true
image: "nginx"
portMappings:
- containerPort: 8080
hostPort: 8080
cpu: 512
memory: 1024
healthCheck:
command:
- CMD-SHELL
- /app/healthcheck.py
interval: 60
retries: 3
startPeriod: 15
timeout: 15
state: present
'''
RETURN = r'''
taskdefinition:
Expand Down

0 comments on commit 8f524f8

Please sign in to comment.