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 Dec 6, 2022
1 parent fad3589 commit 57a9e6f
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/1565-healthCheck-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- "ecs_taskdefinition - Add input documentation for the ``healthCheck`` parameter (https://github.com/ansible-collections/community.aws/pull/1610)"
66 changes: 66 additions & 0 deletions plugins/modules/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 57a9e6f

Please sign in to comment.