Package: kloudy
Aboutkloudy 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.FeaturesUnified command-line interface to multiple cloud providers (AWS and GCP for now)Gets you data across all regions/projects easilyWorks seamlessly with your existing AWS/GCP configuration files and environment variables.Known Limitationsstill in an alpha stageruns only on python 3.6 and aboveInstallationThe easiest way to install kloudy is to use pip in a virtualenv:python3-mvenv.venv
pipinstallkloudyor, if you are not installing in a virtualenv, to install globally:sudopipinstallkloudyor for your user:pipinstallkloudy--userGetting Started - AWSBefore using kloudy, you need to provide it with your AWS credentials. You can do this in several ways:Environment variablesAWS_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,$exportAWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
$exportAWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
$exportAWS_DEFAULT_REGION=us-west-2More details available at,https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.htmlShared credentials fileAWS_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 fileAWS_CONFIG_FILE - Specifies the location of the file that the AWS CLI uses to store configuration profiles. The default path is ~/.aws/config).IAM RoleYou 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,[profilemarketingadmin]role_arn=arn:aws:iam::123456789012:role/marketingadminrolesource_profile=user1More details available at,https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.htmlThe quickest way to get started is to run the aws configure command:$awsconfigure
AWSAccessKeyID:foo
AWSSecretAccessKey:bar
Defaultregionname[us-west-2]:eu-west-1
Defaultoutputformat[None]:jsonUsageLoad your AWS credentials into an environmentRun kloudy command with an appropriate optionSupported options for AWSCloud ProviderCommand SubgroupCommandCommandDescriptionawsbillinglistmonthlylist AWS account monthly chargesmonthly-by-servicelist AWS account monthly charges by servicecloudtraillistlookup-eventslist cloudtrail events which are not read onlyebslistvolumeslist ebs volumesvolume-snapshotlist snapshot for a given ebs volumeec2listamislist AMIsinstanceslist EC2 instanceskey-pairslist key-pairssecurity-groupslist Security Groupsec2describesecurity-groupDescribe a given security groupiamlistuserslist all IAM usersgroupslist all IAM groupsroleslist all IAM roless3listbucketslist all S3 bucketsbuckets-size-in-mblist all S3 buckets by Sizessmlistparameterslist all SSM parameterss3listbucketslist all S3 bucketsvpclistvpcslist all VPCsdetached-elastic-ipslist all unattached EIPsinternet-gatewayslist all internet-gatewaysnat-gatewayslist all nat-gatewaysExampleUsage:kloudyaws[OPTIONS]COMMAND[ARGS]...AWSCloudSubGroup

Options:--helpShowthismessageandexit.

Commands:billingManageAWSBillingresourcescloudtrailManageAWSCloudTrailresourcesebsManageAWSEBSresourcesec2ManageAWSEC2resourcesiamManageAWSIAMresourcess3ManageAWSS3resourcesssmManageAWSSSMresourcesvpcManageAWSvpcresourcesEach command has sub-commands. Run kloudy with --help to list all the possible sub-commands.Getting Started - GCPBefore 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, rungcloudauthapplication-defaultloginUsageLoad your GCP credentials into an environmentRun kloudy command with an appropriate optionSupported options for GCPCloud ProviderCommand SubgroupCommandCommandDescriptiongcpcomputelistinstanceslist compute engine instancesgcpprojectlistprojectslist all GCP projectsExampleUsage:kloudygcp[OPTIONS]COMMAND[ARGS]...GoogleCloudSubGroup

Options:--helpShowthismessageandexit.

Commands:computeGCPcomputeenginesub-groupprojectGCPprojectsub-groupGetting Started - AzurePlease install latest version of Azure CLI using,https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latestBefore 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.azlogin
azadappcreate--display-name"kloudy"--password<password>
azadspcreate--id"<Azure Application Id>"<--ReplaceAzureApplicationIdfromtheoutputoffirstcommand.
azroleassignmentcreate--assignee"<Azure Service Principal Object Id>"--roleOwner<--ReplaceServicecontrolprincipalobjectidfrompreviouscommand.UsageLoad your Azure credentials into an environmentexportAZURE_TENANT_ID={yourtenantid}exportAZURE_CLIENT_ID={yourapplicationid}exportAZURE_CLIENT_SECRET={yourapplicationpassword}exportAZURE_SUBSCRIPTION_ID={yoursubscriptionid}Run kloudy command with an appropriate optionSupported options for AzureCloud ProviderCommand SubgroupCommandCommandDescriptionazureresource-groupslistalllist all the resource groups in your subscriptionExampleUsage:kloudyazure[OPTIONS]COMMAND[ARGS]...AzureCloudSubGroup

Options:--helpShowthismessageandexit.

Commands:resource-groupsManageAzureVirtualMachineresourcegroups