2.3.1 • Published 4 years ago
aws-regions v2.3.1
AWS Regions - Javascript
Usage
$ npm install aws-regions.list(options: Object)
Returns all the regions.
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',
// ...
],
},
// ...
]options-publicIf true, will only return regions publicly available with a regular AWS account. Defaults tofalse.
.lookup(options: Object)
Finds a region by the name or the code.
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',
// ...
],
}options-codeLookup a region by its code (e.g.us-east-1). -nameLookup a region by its name (e.g.N. Virginia).
Zone Limit
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.