Closed aschereT closed 1 year ago
For example, I tried
healthCheck:
command: [ "CMD-SHELL", "wget -q -O /dev/null -T 5 http://localhost:3000/ping || exit 1" ]
startPeriod: 60
but this did not make it into the JSON submitted to ECS.
cc @Java1Guy @alinabuzachis @jillr @markuman @s-hertel @tremble click here for bot help
@aschereT Thank you for raising this. Would you be willing to open a PR to update the documentation and add an example?
@aschereT It must look like this
- name: update_taskdefinition
ecs_taskdefinition:
family: dplctrl
state: present
network_mode: awsvpc
launch_type: FARGATE
execution_role_arn: "arn:aws:iam::1234567890:role/ecsTaskExecutionRole"
task_role_arn: "arn:aws:iam::1234567890:role/dplctrl"
force_create: true
region: eu-central-1
cpu: "256"
memory: "512"
containers:
- name: dplctrl
memoryReservation: 256
essential: true
image: "{{ IMAGE }}"
secrets:
- valueFrom: arn:aws:ssm:eu-central-1:1234567890:parameter/test.website.redis_password
name: REDIS_PASSWORD
portMappings:
- containerPort: 8000
hostPort: 8000
healthCheck:
command:
- CMD-SHELL
- /app/healthcheck.py
interval: 60
retries: 3
startPeriod: 15
timeout: 15
logConfiguration:
logDriver: awslogs
options:
awslogs-group: /deploy.test
awslogs-region: eu-central-1
awslogs-stream-prefix: ecs
register: output
@aschereT Thank you for raising this. Would you be willing to open a PR to update the documentation and add an example?
I made the issue because I didn't know what the format is in the first place...
@markuman Thanks for an example! This is what I'm looking for!
I also made a PR now that I know what the format looks like. https://github.com/ansible-collections/community.aws/pull/1610
Summary
ecs_taskdefinition.containers
acceptshealthCheck
, which is a dictionary. However, it's not explained what the dictionary looks like, and there's no examples at all.Issue Type
Documentation Report
Component Name
ecs_taskdefinition
Ansible Version
Collection Versions
Configuration
OS / Environment
No response
Additional Information
Clarifies what kind of dictionary the healthCheck parameter expects. Provides an example to help developers implement healthCheck more smoothly.
Code of Conduct