Skip to main content

CLI tool for AWS configuration files and quick interogations to AWS API

Project description

pipeline status coverage report Latest Release

Install

# Install or update it from pip
pip install -U kpx

# Install or update it from gitlab
pip install -U kpx --index-url https://gitlab.com/api/v4/projects/24038501/packages/pypi/simple

Contribute

Install poetry globally

curl -sSL https://install.python-poetry.org | python3 -

Clone the project

git clone https://gitlab.com/kisphp/python-cli-tool.git 

Create virtual env inside the project directory

cd python-cli-tool

# create venv
python3 -m venv venv # first venv is the python module called venv, second one is the name of our local virtual environment

Install local dependencies

poetry install

Run application from poetry

poetry run -- kpx # this will show the full list of available commands
poetry run -- kpx ec2 # will list all ec2 instances in your aws account
poetry run -- kpx ec2 -f name=gpu,state=running # list ec2 instances with filtered results

Exit from virtual environment

deactivate # type this in the terminal window and click Enter key

kpx

KPX application for aws profiles

Usage:

$ kpx [OPTIONS] COMMAND [ARGS]...

Options:

  • --install-completion: Install completion for the current shell.
  • --show-completion: Show completion for the current shell, to copy it or customize the installation.
  • --help: Show this message and exit.

Commands:

  • cfg: Configure ~/.aws/config file with profiles...
  • cred: Configure ~/.aws/credentials file with aws...
  • ec2: List EC2 instances
  • ecr: List ECR repositories
  • lb: List Load Balancers
  • n: List EKS nodes and show some information...
  • nodes: List EKS nodes and show some information...
  • r53: List Route53 hosted zones
  • sec: List secrets and show values
  • secret: List secrets and show values
  • v: Show current CLI tool version
  • version: Show current CLI tool version
  • vpc: List VPCs and show Cidr blocks or subnets...

kpx cfg

Configure ~/.aws/config file with profiles settings

Usage:

$ kpx cfg [OPTIONS] [AWS_PROFILE] [REGION] [OUTPUT]

Arguments:

  • [AWS_PROFILE]: [default: default]
  • [REGION]: [default: us-east-1]
  • [OUTPUT]: [default: json]

Options:

  • --help: Show this message and exit.

kpx cred

Configure ~/.aws/credentials file with aws credentials

Usage:

$ kpx cred [OPTIONS] [AWS_PROFILE] [KEY] [SECRET]

Arguments:

  • [AWS_PROFILE]: [default: default]
  • [KEY]
  • [SECRET]

Options:

  • --help: Show this message and exit.

kpx ec2

List EC2 instances

Usage:

$ kpx ec2 [OPTIONS]

Options:

  • -f, --filter TEXT
  • --help: Show this message and exit.

kpx ecr

List ECR repositories

Usage:

$ kpx ecr [OPTIONS] [REPO_NAME]

Arguments:

  • [REPO_NAME]

Options:

  • --help: Show this message and exit.

kpx lb

List Load Balancers

Usage:

$ kpx lb [OPTIONS]

Options:

  • --help: Show this message and exit.

kpx n

List EKS nodes and show some information about them

Usage:

$ kpx n [OPTIONS]

Options:

  • -f, --filter TEXT
  • --help: Show this message and exit.

kpx nodes

List EKS nodes and show some information about them

Usage:

$ kpx nodes [OPTIONS]

Options:

  • -f, --filter TEXT
  • --help: Show this message and exit.

kpx r53

List Route53 hosted zones

Usage:

$ kpx r53 [OPTIONS] [ZONE_ID] [FILTER]

Arguments:

  • [ZONE_ID]
  • [FILTER]

Options:

  • --help: Show this message and exit.

kpx sec

List secrets and show values

Usage:

$ kpx sec [OPTIONS] [SECRET]

Arguments:

  • [SECRET]

Options:

  • -a, --all-namespaces: Show K8S secrets in all namespaces
  • -n, --namespace TEXT: Select namespace
  • --help: Show this message and exit.

kpx secret

List secrets and show values

Usage:

$ kpx secret [OPTIONS] [SECRET]

Arguments:

  • [SECRET]

Options:

  • -a, --all-namespaces: Show K8S secrets in all namespaces
  • -n, --namespace TEXT: Select namespace
  • --help: Show this message and exit.

kpx v

Show current CLI tool version

Usage:

$ kpx v [OPTIONS]

Options:

  • --help: Show this message and exit.

kpx version

Show current CLI tool version

Usage:

$ kpx version [OPTIONS]

Options:

  • --help: Show this message and exit.

kpx vpc

List VPCs and show Cidr blocks or subnets for provided VPC ID

Usage:

$ kpx vpc [OPTIONS] [VPC_ID]

Arguments:

  • [VPC_ID]

Options:

  • --help: Show this message and exit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kpx-0.7.0.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

kpx-0.7.0-py3-none-any.whl (11.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page