ECS Service without running task
ID |
aws_ecs_service_without_task |
Severity |
info |
Vendor |
AWS |
Resource |
Other |
Tags |
non-reachable |
Description
ECS Service without running task. ECS service should have at least one running task.
To fix it you must configure deployment_configuration.minimum_healthy_percent > 0
.
Learn more about this topic at AWS ECS Service.
Examples
---
- name: Example playbook
hosts: localhost
tasks:
- community.aws.ecs_service:
state: present
name: test-service
cluster: test-cluster
task_definition: test-task-definition
desired_count: 3
deployment_configuration:
minimum_healthy_percent: 0
maximum_percent: 100
placement_constraints:
- type: memberOf
expression: 'attribute:flavor==test'
placement_strategy:
- type: binpack
field: memory
Mitigation / Fix
---
- name: Example playbook
hosts: localhost
tasks:
- community.aws.ecs_service:
state: present
name: test-service
cluster: test-cluster
task_definition: test-task-definition
desired_count: 3
deployment_configuration:
minimum_healthy_percent: 50
maximum_percent: 100
placement_constraints:
- type: memberOf
expression: 'attribute:flavor==test'
placement_strategy:
- type: binpack
field: memory