Skip to main content

About

kloudy is a python package which provides a human-friendly command-line interface for your cloud (AWS, GCP & Azure) provider resources. At the moment, it supports AWS and Google cloud however the support for Azure will be added soon.

kloudy is not a replacement to any command-line interface/SDK provided by AWS or GCP.kloudy does not aim to replace any command-line utility provided by cloud provider but it aims to help cloud user/administrator do his/her routine tasks much more easily.

Features

  • Unified command-line interface to multiple cloud providers (AWS and GCP for now)
  • Gets you data across all regions/projects easily
  • Works seamlessly with your existing AWS/GCP configuration files and environment variables.

Known Limitations

  • still in an alpha stage
  • runs only on python 3.6 and above

Installation

The easiest way to install kloudy is to use pip in a virtualenv:

python3 -m venv .venv
pip install kloudy

or, if you are not installing in a virtualenv, to install globally:

sudo pip install kloudy

or for your user:

pip install kloudy --user

Getting Started - AWS

Before using kloudy, you need to provide it with your AWS credentials. You can do this in several ways:

  • Environment variables

    • AWS_ACCESS_KEY_ID - Specifies the secret key associated with the access key. This is essentially the "password" for the access key.
    • AWS_SECRET_ACCESS_KEY - Specifies an AWS access key associated with an IAM user or role.
    • AWS_DEFAULT_REGION - Specifies the AWS Region to send the request to.

    For example,

    $ export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
    $ export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
    $ export AWS_DEFAULT_REGION=us-west-2
    

    More details available at, https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html

  • Shared credentials file

    • AWS_SHARED_CREDENTIALS_FILE - Specifies the location of the file that the AWS CLI uses to store access keys. The default path is ~/.aws/credentials).
  • Config file

    • AWS_CONFIG_FILE - Specifies the location of the file that the AWS CLI uses to store configuration profiles. The default path is ~/.aws/config).
  • IAM Role

    • You can configure the AWS Command Line Interface (AWS CLI) to use an IAM role by defining a profile for the role in the ~/.aws/config file.

    For example,

    [profile marketingadmin]
    role_arn = arn:aws:iam::123456789012:role/marketingadminrole
    source_profile = user1
    

    More details available at, https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html

The quickest way to get started is to run the aws configure command:

$ aws configure
AWS Access Key ID: foo
AWS Secret Access Key: bar
Default region name [us-west-2]: eu-west-1
Default output format [None]: json

Usage

  • Load your AWS credentials into an environment
  • Run kloudy command with an appropriate option

Supported options for AWS

Cloud Provider Command Subgroup Command Command Description
aws billing list monthly list AWS account monthly charges
monthly-by-service list AWS account monthly charges by service
cloudtrail list lookup-events list cloudtrail events which are not read only
ebs list volumes list ebs volumes
volume-snapshot list snapshot for a given ebs volume
ec2 list amis list AMIs
instances list EC2 instances
key-pairs list key-pairs
security-groups list Security Groups
ec2 describe security-group Describe a given security group
iam list users list all IAM users
groups list all IAM groups
roles list all IAM roles
s3 list buckets list all S3 buckets
buckets-size-in-mb list all S3 buckets by Size
ssm list parameters list all SSM parameters
s3 list buckets list all S3 buckets
vpc list vpcs list all VPCs
detached-elastic-ips list all unattached EIPs
internet-gateways list all internet-gateways
nat-gateways list all nat-gateways

Example

Usage: kloudy aws [OPTIONS] COMMAND [ARGS]...

  AWS Cloud SubGroup

Options:
  --help  Show this message and exit.

Commands:
  billing     Manage AWS Billing resources
  cloudtrail  Manage AWS CloudTrail resources
  ebs         Manage AWS EBS resources
  ec2         Manage AWS EC2 resources
  iam         Manage AWS IAM resources
  s3          Manage AWS S3 resources
  ssm         Manage AWS SSM resources
  vpc         Manage AWS vpc resources

Each command has sub-commands. Run kloudy with --help to list all the possible sub-commands.

Getting Started - GCP

Before using kloudy with GCP, you need to provide it with your GCP credentials.

  • In the Cloud Console, on the project selector page, select or create a Cloud project.
  • Make sure that billing is enabled for your Google Cloud project.
  • Install the Cloud SDK.
  • After the SDK is installed, run
gcloud auth application-default login

Usage

  • Load your GCP credentials into an environment
  • Run kloudy command with an appropriate option

Supported options for GCP

Cloud Provider Command Subgroup Command Command Description
gcp compute list instances list compute engine instances
gcp project list projects list all GCP projects

Example

Usage: kloudy gcp [OPTIONS] COMMAND [ARGS]...

  Google Cloud SubGroup

Options:
  --help  Show this message and exit.

Commands:
  compute  GCP compute engine sub-group
  project  GCP project sub-group

Getting Started - Azure

Please install latest version of Azure CLI using,

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

Before using kloudy with Azure, you need to provide it with your Azure credentials.

Its recommended to use service principal for interacting with Azure Rest API. Please follow the following steps to generate service principal credentials for your azure account.

az login
az ad app create --display-name "kloudy"  --password <password>
az ad sp create --id "<Azure Application Id>" <-- Replace Azure Application Id from the output of first command.
az role assignment create --assignee "<Azure Service Principal Object Id>" --role Owner <-- Replace Service control 
principal object id from previous command.

Usage

  • Load your Azure credentials into an environment
    export AZURE_TENANT_ID={your tenant id}
    export AZURE_CLIENT_ID={your application id}
    export AZURE_CLIENT_SECRET={your application password}
    export AZURE_SUBSCRIPTION_ID={your subscription id}
    
  • Run kloudy command with an appropriate option

Supported options for Azure

Cloud Provider Command Subgroup Command Command Description
azure resource-groups list all list all the resource groups in your subscription

Example

Usage: kloudy azure [OPTIONS] COMMAND [ARGS]...

  Azure Cloud SubGroup

Options:
  --help  Show this message and exit.

Commands:
  resource-groups  Manage Azure Virtual Machine resource groups

Metadata

Release files for kloudy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kloudy 0.1.1
File Size Uploaded
kloudy-0.1.1.tar.gz 17.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kloudy 0.1.1
File Interpreter ABI Platform
kloudy-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 36.8 kB

Release files / kloudy-0.1.1.tar.gz

Download URL kloudy-0.1.1.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f4e16c0da2dfb8c6eea13e1341911662a502036b3d955e7c11c3cf211a068a04
BLAKE2b-256 checksum
How to use checksums
71dc234e061f76266e7a172ee52d0ced851d28ca2683bbf0f06075d1aaf6b892
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Release files / kloudy-0.1.1-py3-none-any.whl

Download URL kloudy-0.1.1-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1193ffcbd38ac7d7846d0f08b14a6cc02c5d532f763b6b5bc9fe3bce062be75b
BLAKE2b-256 checksum
How to use checksums
b5d6d76752cd65e9126f1108bbfe03b772013c28f8e2a720ca3f7cd5238a538a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page