Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boto3 1.35.15 incorrect input validation for ResourceId with EC2 instances #4265

Closed
buffyg opened this issue Sep 11, 2024 · 1 comment
Closed
Labels
bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged.

Comments

@buffyg
Copy link

buffyg commented Sep 11, 2024

Describe the bug

The API documentation for tag operations for managed nodes explicitly states that hybrid nodes have a resource id prefix of "mi", while EC2 instances use "i", and it also states that this is equally valid for either node type:

https://docs.aws.amazon.com/systems-manager/latest/userguide/tagging-managed-instances.html#tagging-managed-instances-update

However, taking InstanceId properties from InstanceInformation for EC2 instances produces the expected "i" resource id form, but using this as the ResourceId in a list_tags_for_resource call, using ResourceType "ManagedInstance", results in throwing a ValidationError, indicating that the InstanceId can only use the "mi" resource id form.

Expected Behavior

Client validates the call, makes API call.

Current Behavior

ClientError: An error occurred (ValidationException) when calling the ListTagsForResource operation: resourceId should be in format mi-[0-9a-f]{17} for resource type ManagedInstance

Reproduction Steps

I was generating test samples, but it's fundamentally taking InstanceId properties from the InstanceInformationList for an EC2-only account, using that to iterate through list_tags_for_resources() calls, as in:

response = client.list_tags_for_resource(ResourceId=inst["InstanceId"], ResourceType="ManagedInstance")

Possible Solution

Accept both resource id forms documented as valid, with any further stipulations (the uid component of the resource id is different lengths for each type).

Additional Information/Context

No response

SDK version used

1.35.15

Environment details (OS name and version, etc.)

MacOS, python 3.12.1

@buffyg buffyg added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Sep 11, 2024
@buffyg buffyg closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant