Skip to content

Instantly share code, notes, and snippets.

@rdsedmundo
Created May 11, 2021 09:05
Show Gist options
  • Save rdsedmundo/61276373b59cec3324dc14ff423402c2 to your computer and use it in GitHub Desktop.
Save rdsedmundo/61276373b59cec3324dc14ff423402c2 to your computer and use it in GitHub Desktop.
Compare services available on each AWS region
// https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/
(() => {
const servicesAvailableOnRegion = (region) => Array.from(document.querySelectorAll(`[data-region="${region}"] [data-plc-offer-id]`)).map(node => node.querySelector('a').innerText);
const regions = Array.from(document.querySelectorAll('[data-region]')).map(node => node.getAttribute('data-region'));
const spr = regions.reduce((acc, region) => ({...acc, [region]: servicesAvailableOnRegion(region)}), {});
console.log(spr['us-east-1'].filter(service => !spr['us-east-2'].includes(service)));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment