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.8.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

kpx-0.8.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file kpx-0.8.1.tar.gz.

File metadata

  • Download URL: kpx-0.8.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/5.15.154+

File hashes

Hashes for kpx-0.8.1.tar.gz
Algorithm Hash digest
SHA256 97f2a3bd6dd620acd41c30ae990852d96ef86664d129d83c68ae7f84b5118d41
MD5 afeedf4997369225ae37b2f5ca3169e8
BLAKE2b-256 494df77eb4e858b3115cd4983e6a4f72da04c106f0db40d34361fc8ad3fe27b3

See more details on using hashes here.

File details

Details for the file kpx-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: kpx-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/5.15.154+

File hashes

Hashes for kpx-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b89f8be4d6531a6d3e6030ee843a371ef24c73133f62de0f63770f90b6a8b7f
MD5 7796fb509590fdb03024f79cca60dfd1
BLAKE2b-256 833021bf40b8f3ebe5badcdfa4a4a639a980706b85a390e0b9b04904a45dd546

See more details on using hashes here.

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