Get multiple EC2 instances at once. Loads all data in a single bulk fetch then serves from cache.
Array of instance types to fetch
Promise resolving to Map of instance type to details
import { getEC2Instances } from 'aws-instance-info/async'const instances = await getEC2Instances(['m5.large', 'm5.xlarge', 'c7.2xlarge'])for (const [type, details] of instances) { console.log(`${type}: ${details.vCPUs} vCPUs`)}// m5.large: 2 vCPUs// m5.xlarge: 4 vCPUs// c7.2xlarge: 8 vCPUs Copy
import { getEC2Instances } from 'aws-instance-info/async'const instances = await getEC2Instances(['m5.large', 'm5.xlarge', 'c7.2xlarge'])for (const [type, details] of instances) { console.log(`${type}: ${details.vCPUs} vCPUs`)}// m5.large: 2 vCPUs// m5.xlarge: 4 vCPUs// c7.2xlarge: 8 vCPUs
Get multiple EC2 instances at once. Loads all data in a single bulk fetch then serves from cache.