CloudTrail: Fix start_logging/stop_logging to accept trail ARN - #10131
Open
Mide69 wants to merge 1 commit into
Open
CloudTrail: Fix start_logging/stop_logging to accept trail ARN#10131Mide69 wants to merge 1 commit into
Mide69 wants to merge 1 commit into
Conversation
start_logging and stop_logging did a raw self.trails[name] lookup, raising KeyError when called with a trail ARN instead of a name. Route through the existing get_trail() helper (already used by update_trail and others) so both name and ARN resolve correctly, and unknown trails raise TrailNotFoundException as AWS does.
Contributor
|
Duplicates #10119 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CloudTrail: Fix start_logging/stop_logging to accept trail ARN
Closes #10107
start_logging/stop_logging did a raw self.trails[name] dict lookup, which raises KeyError when called with a trail ARN; AWS accepts both name and ARN for these operations, and get_trail_status already handles this correctly. Routes both methods through the existing ARN-tolerant get_trail() helper instead, matching the pattern already used by update_trail, put_event_selectors, etc. Unknown trails now correctly raise TrailNotFoundException.
Added tests covering start/stop by ARN and the not-found case for both methods. The full test_cloudtrail suite (45 tests) passes, and the ruff check/ruff format --check/mypy all clean.