getmoto / moto

A library that allows you to easily mock out tests based on AWS infrastructure.
http://docs.getmoto.org/en/latest/
Apache License 2.0
7.6k stars 2.03k forks source link

[BUG FIX] EC2: Exclude existing tags to be overwritten from the TagLimitExceeded validation #8150

Closed elstak closed 3 days ago

elstak commented 4 days ago

Although EC2 API does not provide a method to update existing tags, CreateTags will overwrite existing tag keys with the new given value. Therefore, existing tags passed as argument to create_tags() method should not be taken into consideration to validate TagLimitExceeded exception when the resource underneath exists.

It has been tested in AWS that, updating one or more tag values of a resource which tag count is already on the limit (50), works well using AWS CLI, boto3 and Terraform.

codecov[bot] commented 4 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.50%. Comparing base (6c68326) to head (10f0fa0). Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #8150 +/- ## ======================================= Coverage 94.50% 94.50% ======================================= Files 1150 1150 Lines 99203 99203 ======================================= Hits 93752 93752 Misses 5451 5451 ``` | [Flag](https://app.codecov.io/gh/getmoto/moto/pull/8150/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) | Coverage Δ | | |---|---|---| | [servertests](https://app.codecov.io/gh/getmoto/moto/pull/8150/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) | `28.79% <ø> (ø)` | | | [unittests](https://app.codecov.io/gh/getmoto/moto/pull/8150/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) | `94.47% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.