vantage-sh / ec2instances.info

Amazon EC2 instance comparison site
https://ec2instances.info
MIT License
5.07k stars 578 forks source link

[Critical] Wrong Data is Feteched for Some Regions #714

Closed mo-haggag closed 8 months ago

mo-haggag commented 10 months ago

The following regions wrongly default to the prices of US East (N. Virginia):

EverettBerry commented 10 months ago

Thanks! Guessing some bad defaults. Will get this fixed.

mo-haggag commented 10 months ago

Thanks for the quick response. For reference, after additional tests, it seems that this problem exists in all Local Zones and Wavelength Zones.

EverettBerry commented 10 months ago

So the data looks right to me when the region is selected in the dropdown. However there might be an issue with loading the region from the URL. But the data itself is correct.

image image

mo-haggag commented 10 months ago

Right. So when I tried to access it directly by appending the correct region code it didn't work, however, when I selected the region from the drop-down menu it loaded the correct data, albeit using a completely wrong region code. This issue seems to happen only with Local Zones and Wavelength Zones.

EverettBerry commented 9 months ago

@mo-haggag I had a chance to look at this more deeply and the problem is this: the region codes you are using are not the region codes which are available in the pricing digest. For example, for the first URL above the region code that exists in the pricing data is ap-northeast-1-wl1-nrt1 instead of ap-northeast-1-wl1-nrt-wlz-1.

I'm not sure I have a good solution here. If you are building an application that needs these URLs to match the region codes here, https://aws.amazon.com/wavelength/locations/, there is a decoding which works for most cases.

You can take the last part of the code, nrt-wlz-1, and transform it to be nrt1 (eliminate the -wlz-).

EverettBerry commented 8 months ago

I'm going to close this for now but would be open to implementing a solution in the future which incorporates that region decoding algo into the codebase.