Fix: Handle AWS ECS 10-service limit in describe_services #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Clusters with more than 10 services were crashing with the error:
Error: An error occurred (InvalidParameterException) when calling the DescribeServices operation: service names can have at most 10 items.
AWS ECS
describe_services
API has a hard limit of 10 services per call, but the code was attempting to describe all services in a single request.Solution
Implemented batching for
describe_services
calls to process services in groups of 10:Added
batch_items()
utility function (src/lazy_ecs/core/utils.py
)Updated
ServiceService.get_service_info()
(src/lazy_ecs/features/service/service.py
)describe_services
calls as neededAdded comprehensive tests
test_batch_items_*
: Tests for utility function with various edge casestest_get_service_info_with_more_than_10_services
: Verifies batching works correctly with 15 servicesCloses #37