• Public
  • Public/Protected
  • All

Module get-aws-results

A standardised solution for AWS operation pagination using the AWS Javascript SDKv2 that can replace direct interaction with the AWS API with a single function


Type aliases


Type aliases


PaginationMetadata: { Pageable: boolean; Paged: boolean; Pages?: number }

Metadata describing the pagination status of the result

Type declaration

  • Pageable: boolean

    Whether the operation is pageable

  • Paged: boolean

    Whether the result was paged

  • Optional Pages?: number

    How many pages pageable result was built from


Const getAwsResults

  • getAwsResults(service: string, operation: string, clientParams?: any, operationParams?: any, resultKey?: undefined | string): Promise<any>
  • Execute an AWS API call just as if you had called the constructor and operation yourself, but automatically paginating any results returned if the SDK has the capability to do so.


    • service: string

      The AWS Service Constructor you want to use, in TitleCase, e.g. Route53 or EC2

    • operation: string

      The Service operation you want, in camelCase, e.g. listHostedZones or describeInstances

    • clientParams: any = {}

      The Parameters you want to pass to the client constructor, e.g. {region: 'us-east-1', maxRetries: 100}

    • operationParams: any = {}

      The Parameters you want to pass to the operation, e.g. {maxItems: '3', Id: <ResourceID>}

    • resultKey: undefined | string = ...

      The optional resultKey to pull results from, like passing --query .<keyName> to the AWS cli

    Returns Promise<any>

    Whatever the AWS API returns, either as the results of a singular key, or with the additional metadata

Generated using TypeDoc