moto icon indicating copy to clipboard operation
moto copied to clipboard

Bug - Route53 IDs inconsistant with API

Open zkarpinski opened this issue 5 months ago • 1 comments

I'll try to add more info over next few days.

TLDR: Route53's API specs from AWS are inconsistent with the resource IDs. Some return /hostedzone/abcd1234567 others return abc1234567

It appears most apis from AWS only accept the true ID and not the /%resource_type%/ prefix. Take for instance list_tags_for_resources if you provide the full id /hostedzone/abcd1234567 the resource is not found or the ID parameter greater than the allowed character limit for the aws cli. This same API's response returns the shorter resource id 'ResourceTagSets': [{'ResourceType': 'hostedzone', 'ResourceId': 'AVGQ56HKPAQLME0', 'Tags': [{'Key': 'Deploy', 'Value': 'True'}, {'Key': 'Name', 'Value': 'UnitTest'}]}]}

A counter example is list_hosted_zones, it return the longer resource id /hostedzone/abcd1234567

It seems the route53 implementation may need some refactoring. As a short term fix, perhaps we can accept both "ID" styles and handle appropriately? Unfortunately the AWS docs don't show which form is returned...

The issue is you cannot simply take the ID from the create and use it with other api endpoints. You must parse out the ID from the longer form.

@bblommers thoughts?

zkarpinski avatar Sep 24 '24 14:09 zkarpinski