π§ AWS ECS Service is overutilized - prod.logic.yamlπ’
- Contextual name: π§ prod.logic.yamlπ’
- ID:
/ce/ca/aws/ecs/service-overutilized/prod.logic.yaml - Tags:
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Usesβ
- π AWS ECS Service
- π AWS ECS Service - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2026-11-28T12:02:45.415758510Z Open
| Result | Id | Condition Index | Condition Text | Runtime Error |
|---|---|---|---|---|
| π’ | disappeared | βοΈ 99 | βοΈ isDisappeared(CA10__disappearanceTime__c) | βοΈ null |
| π’ | draining | βοΈ 199 | βοΈ extract('CA10__status__c') != 'ACTIVE' | βοΈ null |
| π’ | unrecognized-status | βοΈ 199 | βοΈ extract('CA10__status__c') != 'ACTIVE' | βοΈ null |
| π’ | missing-status | βοΈ 101 | βοΈ CA10__status__c.isEmpty() | βοΈ null |
| π’ | daemon | βοΈ 299 | βοΈ extract('CA10__schedulingStrategy__c') != 'REPLICA' | βοΈ null |
| π’ | unrecognized-strategy | βοΈ 299 | βοΈ extract('CA10__schedulingStrategy__c') != 'REPLICA' | βοΈ null |
| π’ | missing-strategy | βοΈ 201 | βοΈ CA10__schedulingStrategy__c.isEmpty() | βοΈ null |
| π’ | scaled-to-zero | βοΈ 499 | βοΈ extract('CA10__runningCount__c') <= number(0.0) || extract('CA10__runningCount__c') != extract('CA10__desiredCount__c') || extract('CA10__pendingCount__c') != number(0.0) | βοΈ null |
| π’ | task-count-mismatch | βοΈ 499 | βοΈ extract('CA10__runningCount__c') <= number(0.0) || extract('CA10__runningCount__c') != extract('CA10__desiredCount__c') || extract('CA10__pendingCount__c') != number(0.0) | βοΈ null |
| π’ | pending-tasks | βοΈ 499 | βοΈ extract('CA10__runningCount__c') <= number(0.0) || extract('CA10__runningCount__c') != extract('CA10__desiredCount__c') || extract('CA10__pendingCount__c') != number(0.0) | βοΈ null |
| π’ | missing-running-count | βοΈ 301 | βοΈ CA10__runningCount__c.isEmpty() | βοΈ null |
| π’ | missing-desired-count | βοΈ 302 | βοΈ CA10__desiredCount__c.isEmpty() | βοΈ null |
| π’ | missing-pending-count | βοΈ 303 | βοΈ CA10__pendingCount__c.isEmpty() | βοΈ null |
| π’ | too-recent | βοΈ 599 | βοΈ not(extract('CA10__createdAt__c').beyondLastDays(13)) | βοΈ null |
| π’ | missing-created-at | βοΈ 501 | βοΈ CA10__createdAt__c.isEmpty() | βοΈ null |
| π’ | age-boundary | βοΈ 1000 | βοΈ otherwise | βοΈ null |
| π’ | missing-cpu | βοΈ 699 | βοΈ extract('CA10__averageCpuUtilizationTwoWeeks__c').isEmpty() || extract('CA10__averageCpuUtilizationTwoWeeks__c') < number(0.0) || extract('CA10__averageMemoryUtilizationTwoWeeks__c').isEmpty() || extract('CA10__averageMemoryUtilizationTwoWeeks__c') < number(0.0) | βοΈ null |
| π’ | missing-memory | βοΈ 699 | βοΈ extract('CA10__averageCpuUtilizationTwoWeeks__c').isEmpty() || extract('CA10__averageCpuUtilizationTwoWeeks__c') < number(0.0) || extract('CA10__averageMemoryUtilizationTwoWeeks__c').isEmpty() || extract('CA10__averageMemoryUtilizationTwoWeeks__c') < number(0.0) | βοΈ null |
| π’ | invalid-metric | βοΈ 699 | βοΈ extract('CA10__averageCpuUtilizationTwoWeeks__c').isEmpty() || extract('CA10__averageCpuUtilizationTwoWeeks__c') < number(0.0) || extract('CA10__averageMemoryUtilizationTwoWeeks__c').isEmpty() || extract('CA10__averageMemoryUtilizationTwoWeeks__c') < number(0.0) | βοΈ null |
| π’ | zero | βοΈ 1000 | βοΈ otherwise | βοΈ null |
| π’ | both-below-idle-threshold | βοΈ 1000 | βοΈ otherwise | βοΈ null |
| π’ | idle-boundary-cpu | βοΈ 1000 | βοΈ otherwise | βοΈ null |
| π’ | idle-boundary-memory | βοΈ 1000 | βοΈ otherwise | βοΈ null |
| π’ | both-below-low-threshold | βοΈ 1000 | βοΈ otherwise | βοΈ null |
| π’ | low-boundary-cpu | βοΈ 1000 | βοΈ otherwise | βοΈ null |
| π’ | low-boundary-memory | βοΈ 1000 | βοΈ otherwise | βοΈ null |
| π’ | high-boundary-cpu | βοΈ 899 | βοΈ extract('CA10__averageCpuUtilizationTwoWeeks__c') >= number(80.0) | βοΈ null |
| π’ | high-boundary-both | βοΈ 799 | βοΈ extract('CA10__averageCpuUtilizationTwoWeeks__c') >= number(80.0) && extract('CA10__averageMemoryUtilizationTwoWeeks__c') >= number(80.0) | βοΈ null |
| π’ | high-boundary-memory | βοΈ 999 | βοΈ extract('CA10__averageMemoryUtilizationTwoWeeks__c') >= number(80.0) | βοΈ null |
| π’ | above-100-is-valid | βοΈ 999 | βοΈ extract('CA10__averageMemoryUtilizationTwoWeeks__c') >= number(80.0) | βοΈ null |
| π’ | missing-both-1-day-averages | βοΈ 899 | βοΈ extract('CA10__averageCpuUtilizationTwoWeeks__c') >= number(80.0) | βοΈ null |
| π’ | negative-task-count | βοΈ 399 | βοΈ extract('CA10__runningCount__c') < number(0.0) || extract('CA10__desiredCount__c') < number(0.0) || extract('CA10__pendingCount__c') < number(0.0) | βοΈ null |
Generation Bundleβ
| File | MD5 | |
|---|---|---|
| Open | /ce/ca/aws/ecs/service-overutilized/policy.yaml | 348A087B3AAFC9E38BACC46FF71E1FAB |
| Open | /ce/ca/aws/ecs/service-overutilized/prod.logic.yaml | E66C19E6A492B790073F6915095BD28D |
| Open | /ce/ca/aws/ecs/service-overutilized/test-data.json | 6EAAF6F72C9B0979D53B1933F087CE40 |
| Open | /types/CA10__CaAwsEcsService__c/object.extracts.yaml | 7191A37A7677349208058A8EF254A196 |
Available Commandsβ
repo-manager policies generate FULL /ce/ca/aws/ecs/service-overutilized/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/aws/ecs/service-overutilized/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/aws/ecs/service-overutilized/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/aws/ecs/service-overutilized/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/aws/ecs/service-overutilized/prod.logic.yaml
Contentβ
---
inputType: CA10__CaAwsEcsService__c
importExtracts:
- file: /types/CA10__CaAwsEcsService__c/object.extracts.yaml
testData:
- file: test-data.json
conditions:
- status: INAPPLICABLE
currentStateMessage: The service has a status other than ACTIVE.
check:
NOT_EQUAL:
left:
EXTRACT: CA10__status__c
right:
TEXT: ACTIVE
- status: INAPPLICABLE
currentStateMessage: The service uses a scheduling strategy other than REPLICA.
check:
NOT_EQUAL:
left:
EXTRACT: CA10__schedulingStrategy__c
right:
TEXT: REPLICA
- status: UNDETERMINED
currentStateMessage: An ECS service task count is below zero.
check:
OR:
args:
- LESS_THAN:
left:
EXTRACT: CA10__runningCount__c
right:
NUMBER: 0
- LESS_THAN:
left:
EXTRACT: CA10__desiredCount__c
right:
NUMBER: 0
- LESS_THAN:
left:
EXTRACT: CA10__pendingCount__c
right:
NUMBER: 0
- status: INAPPLICABLE
currentStateMessage: The service has no running tasks, a task count different from the desired count, or pending tasks.
check:
OR:
args:
- LESS_THAN_EQUAL:
left:
EXTRACT: CA10__runningCount__c
right:
NUMBER: 0
- NOT_EQUAL:
left:
EXTRACT: CA10__runningCount__c
right:
EXTRACT: CA10__desiredCount__c
- NOT_EQUAL:
left:
EXTRACT: CA10__pendingCount__c
right:
NUMBER: 0
- status: INAPPLICABLE
currentStateMessage: The service was created fewer than 14 calendar days ago.
check:
NOT:
arg:
IS_BEYOND_LAST_DAYS:
arg:
EXTRACT: CA10__createdAt__c
offsetDays: 13
- status: UNDETERMINED
currentStateMessage: One or more 14-day service CloudWatch averages are missing or below zero.
check:
OR:
args:
- IS_EMPTY:
arg:
EXTRACT: CA10__averageCpuUtilizationTwoWeeks__c
- LESS_THAN:
left:
EXTRACT: CA10__averageCpuUtilizationTwoWeeks__c
right:
NUMBER: 0
- IS_EMPTY:
arg:
EXTRACT: CA10__averageMemoryUtilizationTwoWeeks__c
- LESS_THAN:
left:
EXTRACT: CA10__averageMemoryUtilizationTwoWeeks__c
right:
NUMBER: 0
- status: INCOMPLIANT
currentStateMessage: Both CPU and memory utilization averaged at least 80% over 14 days.
remediationMessage: Review CPU and memory demand, application health, and scaling behavior before changing capacity.
check:
AND:
args:
- GREATER_THAN_EQUAL:
left:
EXTRACT: CA10__averageCpuUtilizationTwoWeeks__c
right:
NUMBER: 80
- GREATER_THAN_EQUAL:
left:
EXTRACT: CA10__averageMemoryUtilizationTwoWeeks__c
right:
NUMBER: 80
- status: INCOMPLIANT
currentStateMessage: CPU utilization averaged at least 80% over 14 days.
remediationMessage: Investigate CPU demand, throttling, and scaling behavior before changing capacity.
check:
GREATER_THAN_EQUAL:
left:
EXTRACT: CA10__averageCpuUtilizationTwoWeeks__c
right:
NUMBER: 80
- status: INCOMPLIANT
currentStateMessage: Memory utilization averaged at least 80% over 14 days.
remediationMessage: Check memory reservations, limits, and task restarts before changing capacity.
check:
GREATER_THAN_EQUAL:
left:
EXTRACT: CA10__averageMemoryUtilizationTwoWeeks__c
right:
NUMBER: 80
otherwise:
status: COMPLIANT
currentStateMessage: Both 14-day utilization averages are below 80%.