Skip to content

Logs: resolve the requested log group identifier - #10549

Open
narayana006 wants to merge 1 commit into
getmoto:masterfrom
narayana006:candidate/logs-identifier-lookup
Open

narayana006 wants to merge 1 commit into
getmoto:masterfrom
narayana006:candidate/logs-identifier-lookup

Conversation

@narayana006

Copy link
Copy Markdown

CloudWatch Logs: resolve the requested log group identifier

DescribeLogStreams(logGroupIdentifier=) currently returns streams from the last-created group. An unknown identifier can likewise select an unrelated group instead of raising ResourceNotFoundException. The lookup loop overwrites its result on every iteration and never stops on a match.

Resolve names directly and stop at the matching ARN. Leave unmatched identifiers unresolved so the existing ResourceNotFoundException path runs. Six regression cases cover correct and missing names/ARNs through DescribeLogStreams and GetLogEvents.

Expected behavior follows the DescribeLogStreams API reference.

Validation: all six regression cases fail with the unchanged implementation and pass after the fix. The offline CloudWatch Logs suite passes: 132 passed, 2 deselected. The two omitted Lambda subscription integration tests require Docker; an initial full run failed on Docker permissions. One unrelated query-time test failed once and passed on unchanged code and on the final run. Repository-wide Ruff checks and formatting, targeted mypy for moto/logs/models.py, and git diff --check pass. No real AWS verification or full-project mypy is claimed.

Prepared with OpenAI Codex assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant