aws-instance-info - v1.0.0
    Preparing search index...

    Function getEC2Instances

    • Get multiple EC2 instances at once. Loads all data in a single bulk fetch then serves from cache.

      Parameters

      • instanceTypes: string[]

        Array of instance types to fetch

      Returns Promise<Map<string, EC2InstanceDetails>>

      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