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

Bug - Route53 IDs inconsistant with API #8153

Open
zkarpinski opened this issue Sep 24, 2024 · 1 comment
Open

Bug - Route53 IDs inconsistant with API #8153

zkarpinski opened this issue Sep 24, 2024 · 1 comment
Labels

Comments

@zkarpinski
Copy link
Contributor

zkarpinski commented Sep 24, 2024

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?

@bblommers
Copy link
Collaborator

Well, that's a pain, and definitely weird behaviour!

As a short term fix, perhaps we can accept both "ID" styles and handle appropriately?

Absolutely, that's probably the best way forward.

If/when we determine the exact rules when short resource ID is used/accepted, and when the long version, we can always think about a more thorough refactor. But for now - maximum flexibility in what Moto accepts is best IMO.

@bblommers bblommers added the bug label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants