Get multiple EC2 instances at once. More efficient than calling getEC2InstanceInfo multiple times for batch operations.
Array of instance types to fetch
Map of instance type to details
import { getEC2Instances } from 'aws-instance-info'const instances = 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'const instances = 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. More efficient than calling getEC2InstanceInfo multiple times for batch operations.