ResourceGroupsTaggingAPI: Migration for Integrated Services#13821
ResourceGroupsTaggingAPI: Migration for Integrated Services#13821
Conversation
Test Results - Preflight, Unit23 070 tests - 53 21 179 ✅ - 73 6m 3s ⏱️ -7s Results for commit 8ad96a6. ± Comparison against base commit a857a31. This pull request removes 74 and adds 21 tests. Note that renamed tests count towards both.This pull request skips 19 tests.♻️ This comment has been updated with latest results. |
S3 Image Test Results (AMD64 / ARM64) 2 files 2 suites 8m 32s ⏱️ Results for commit 8ad96a6. |
bentsku
left a comment
There was a problem hiding this comment.
LGTM, very nice set of changes 💯
Only very minor comments, but I think we should get this PR in ASAP and fix those later if we want to, this way we can migrate the last services 👍 Very nice work churning through all of those services and cleaning up 🧹
Also, thanks a lot for fixing S3 cross-account cross-region behavior for tags 🙏 this looks great
There was a problem hiding this comment.
good to move out logic from the models to the provider 👍 nice work
| custom_key_material = None | ||
| tags = request.get("Tags", []) | ||
| for tag in tags: | ||
| if tag["TagKey"] == TAG_KEY_CUSTOM_KEY_MATERIAL: | ||
| custom_key_material = base64.b64decode(tag["TagValue"]) | ||
|
|
||
| return custom_key_material |
There was a problem hiding this comment.
nit: this could be simplified a bit directly returning in the if block if we find the tag key, but not worth changing I believe 👍
| @staticmethod | ||
| def get_route53_store(account_id: str, region: str) -> Route53Store: | ||
| return route53_stores[account_id][region] |
There was a problem hiding this comment.
nit: this maybe could have been in the Pro implementation as it isn't used here (in case somebody deletes it), but is also fine to leave right now to not delay merging this, we can cleanup later!
There was a problem hiding this comment.
nice changes for S3, thanks for fixing up the cross-account cross-region nature of the tags! this is much better!
| _tags if the resource has been deleted. | ||
|
|
||
| This distinction is important to maintain parity with the Resource Groups Tagging API (RGTA) which will tap into | ||
| supported service's `Tags` dataclass within it's store. |
There was a problem hiding this comment.
Nit, let's clean up later 👍
| supported service's `Tags` dataclass within it's store. | |
| supported service's `Tags` dataclass within its store. |
Motivation
Tagscollection, and for us to move away fromTaggingServiceChanges
Tagsutility.Tagsdataclass which replacesTaggingService(and theTaggerin Pro) which stores tags as a dict which maps tag keys to tag values but also adds aget_resource_tags_mapmethod which exposes it's entire resource tags state.Tagscollection.Tagscollection. Updated tagging utils to now to now use this newtagsfield.TAGSwhich usesTaggingServiceto instead have thetagsfield which uses theTagscollection. Updated tagging utils to use this updated field.TAGSwhich usesTaggingServiceto instead have thetagsfield which uses theTagscollection. Updated tagging utils to use this updated field.tagsfield usingTagson theroute53_storesstore. Tagging methods were updated accordingly.s3tables.Tagscollection undertagsinstead ofTaggingServiceandTAGS. It is also stored under a LocalAttribute instead of aCrossAccountAttribute. Tagging methods updated accordingly.TAGSfield which usedTaggingServicetotagswhich usesTagsand the already existing tagging methods for S3 buckets were updated.Taggersince RGTA doesn't support these resources. We now require these resources to be stored in the same place so new methods have been created to tag these resources also. Additional code has been added in Pro to deal with these scenarios for RGTA.tagsa local attribute and accessing tags by using the bucket region and bucket account as these buckets are cross account and cross region accessible.KmsKeyclass has been removed. This was mostly because keeping this logic would result in repeated logic for tag validation and tag storage.KmsKeyclass has been updated to decouple this class from this logic.