cdklabs/cdk-ecs-service-extensions

AssignPublicIpExtension's EventHandler Lambda incorrectly parses ECS Task information

Closed this issue · 0 comments

The method QueueHandler.collect_event_task_info, used by AssignPublicIpExtension's EventHandler Lambda function, filters for Task state change events by checking event records for the presence of a 'details' attribute.

for message in decode_records(event):
if 'details' not in message:
logging.info(f'Received a non-task state message {message}')
continue
task_description = message['details']

It should instead be checking for 'detail', since that is the expected name of the attribute according to AWS ECS Events, Task state change events in the Developer Guide.

This change is required for the EventHandler Lambda function to make the correct updates to the record set and the DynamoDB table. FWIW, I have verified that changing 'details' to 'detail' on Lines 65 and 69 fixes the issue.