Repository navigation
aws - copy-related-tag - fetch resourcegroupstaggingapi tags in batches of 100 - #11301
Merged
ajkerrigan merged 2 commits intoNov 12, 2026
Merged
ajkerrigan merged 2 commits into
ajkerrigan merged 2 commits into
Conversation
…es of 100 copy-related-tag with resource: resourcegroupstaggingapi passed every related arn to a single GetResources call. ResourceARNList takes 1 to 100 arns, so more than 100 related arns goes over the documented limit, and zero (none of the matched resources carry the key) fails botocore param validation before any request is sent. Look the arns up in chunks of 100, the same way universal_augment already does, and skip the call when there are none. Also drop the get_resources paginator that was built but never used. GetResources rejects pagination params when ResourceARNList is set anyway.
|
|
ajkerrigan
enabled auto-merge (squash)
November 12, 2026 14:50
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.
Fixes #11300
copy-related-tagwithresource: resourcegroupstaggingapisent every related arn to oneGetResourcescall.ResourceARNListtakes 1 to 100 arns (API reference, same min/max in the botocore model), so over 100 related arns is over the limit, and zero related arns raises botocore'sParamValidationError: Invalid length for parameter ResourceARNList, value: 0, valid min length: 1before any request goes out.Change:
get_resource_tag_map_universalnow looks the arns up withutils.chunks(ids, 100), same asuniversal_augmentalready does for this api. an empty set makes no call and returns{}, so those resources just count as missing like any other unresolved related id. that means the empty case now followsskip_missing(skipped by default,PolicyExecutionErrorwithskip_missing: false) instead of raisingParamValidationError. 100 or fewer arns is still a single call.I also removed the
get_resourcespaginator in that method. it was built and never used, and GetResources rejects pagination params whenResourceARNListis set, so it couldn't have been used here anyway.Test:
test_copy_related_tag_resourcegroupstaggingapi_batcheschecks 250 arns go out as 100 + 100 + 50 with every arn's tags in the result, and that an empty set makes no call. fails on main ([250] != [100, 100, 50]), passes with the fix. a fullpytest -n auto testsrun gives the same result as main plus the new test, andruff check c7n tests toolsis clean.