Skip to content

jcoreio/aws-select-cli-prompts

Repository files navigation

@jcoreio/aws-select-cli-prompts

CircleCI Coverage Status semantic-release Commitizen friendly npm version

CLI prompts to select AWS resources via aws-sdk

Installation

npm i --save @jcoreio/aws-select-cli-prompts

API

selectEC2Instance

import { selectEC2Instance } from '@jcoreio/aws-select-cli-prompts'

Prompts the user to select an EC2 Instance. Returns a promise that resolves to the selected AWS.EC2.Instance.

Options

ec2?: AWS.EC2 = new AWS.EC2()

The EC2 API instance to use.

Filters?: AWS.EC2.DescribeInstancesRequest['Filters'] = []

Additional filters to use.

MaxResults?: number = 100

The maximum number of EC2 instances to fetch.

useRecents?: boolean = true

If true, load recent instances the user has selected in the past (from ~/.aws-select-cli-prompts/recents.json) and present them when the filter text is empty. After the user makes a selection it will be saved tot he recents file.

selectEBSSnapshot

import { selectEBSSnapshot } from '@jcoreio/aws-select-cli-prompts'

Prompts the user to select an EBS Snapshot. Returns a promise that resolves to the selected AWS.EC2.Snapshot.

Options

ec2?: AWS.EC2 = new AWS.EC2()

The EC2 API instance to use.

Filters?: AWS.EC2.DescribeSnapshotsRequest['Filters'] = []

Additional filters to use.

MaxResults?: number = 100

The maximum number of snapshots to fetch.

useRecents?: boolean = true

If true, load recent instances the user has selected in the past (from ~/.aws-select-cli-prompts/recents.json) and present them when the filter text is empty. After the user makes a selection it will be saved tot he recents file.