List of AWS Regions and Availability Zones
npm install aws-regions``bash`
$ npm install aws-regions
Returns all the regions.
`javascript
const awsRegions = require('aws-regions')
awsRegions.list() ===
[
{
name: 'N. Virginia',
full_name: 'US East (N. Virginia)',
code: 'us-east-1',
public: true,
zones: [
'us-east-1a',
// ...
],
},
// ...
]
`
- optionspublic
- If true, will only return regions publicly available with a regular AWS account. Defaults to false.
Finds a region by the name or the code.
`javascript
const awsRegions = require('aws-regions')
awsRegions.lookup({ code: 'us-east-1' }) ===
{
name: 'N. Virginia',
full_name: 'US East (N. Virginia)',
code: 'us-east-1',
public: true,
zones: [
'us-east-1a',
// ...
],
}
`
- optionscode
- Lookup a region by its code (e.g. us-east-1).name
- Lookup a region by its name (e.g. N. Virginia).
If a region's data object includes zone_limit: int`, that means AWS accounts are limited to this number of availability zones (which will differ based on when your account was created.) You'll need to get your specific availability zones for this region with the AWS API or CLI.