Skip to main content

Command-Line Instance Control for AWS, Azure, GCP and AliCloud

Project description

Unified Instance control across Enterprise Cloud Providers

PyPi release lang

Multi-Cloud-Control provides a single solution for controlling cloud VMs/Instances across AWS, Azure, GCP and Alibaba Cloud. It displays a combined list of VM-instances across providers, and allows starting, stopping and making connections. It’s extremely useful for shell users who work in multi-cloud environments.

This utility can be executed with two different commands:

  • mccl - runs in “List Mode”, which displays a unified list of instances and their state across providers

  • mcc - runs in “Command Mode”, which displays a unified instance list and allows for command execution

mccl

  • mccl Displays a unified list of VM/instances and their parameters across providers

    • useful when quick access to information is needed; it displays a list of instances and their state and exits

List Mode screenshot

https://user-images.githubusercontent.com/1554603/33449863-4b1e182a-d5c7-11e7-958e-a1fac2ec1ee5.png

mcc

  • mcc Displays a unified list of VM-Instances across providers and enables command execution

    • Designed for use when control of VM/instance is needed

    • After listing instances and command options, the authenticated connection to the provider is maintained, and it awaits user command selection

    • Supports commands for starting, stopping and connecting (via ssh)

    • Future commands may include: creating/deleting instances, changing configuration (hardware, disks, network), managing imaging/snapshots, managing disk/storage, add/remove to groups/clusters

Command Mode screenshot

https://user-images.githubusercontent.com/1554603/33449859-47c4677e-d5c7-11e7-8974-9212c31e785f.png

Supported Python versions & Platforms

Python 2.7, 3.4, 3.5, 3.6, 3.7

Platforms:

  • Linux

  • macOS (OS X)

  • Windows 10 - Linux Shells

Pre-Reqs

The libraries used for secure authentication may require compilation during the installation process on some systems. In order to successfully compile these dependencies, the following packages must be installed before installation:

Installing Pre-Reqs on Debian / Ubuntu Based Systems:

sudo apt-get install gcc python-dev libssl-dev libffi-dev -y

Installing Pre-Reqs on RedHat / CentOS Based Systems:

sudo yum install gcc python-devel openssl-devel libffi-devel -y

Installation

This utility can be installed with pip:

pip install --user mcc

Configuration

New Configuration Instructions can be found on the mcc wiki

The first time the utility is executed it performs the following setup tasks:

  • Creates its config directory {HOME}/.cloud

  • Copies a sample config.ini file to the new config dir

  • Instructs the user to add their credential information to config.ini

    • The sample config.ini contains sample configuration data, and extensive comments describing how to add your real data.

Notes while editing the config.ini file:

  • do not change the names of the keys (titles left of the ‘=’ symbol)

  • lines with comments may be deleted (lines beginning with #)

config.ini - info section and providers list

# 'INFO' SECTION AND 'PROVIDERS' LIST
# - There must be a section named [info] and it must contain the entry providers
#
# - providers is a list of the cloud providers the utility should connect to
#   - ONLY include providers you have credentials for AND want to use
#   - you must use the exact values listed to reference the providers:
#     - "alicloud", "aws", "azure", and "gcp"
#   - multiple account per provider is supported, see section at bottom for details

[info]
# this example - connects to all three providers
providers = alicloud,aws,azure,gcp

# CREDENTIALS DATA SECTIONS
#  - one section with matching name for each item listed in providers
#  - each section contains the credentials for that provider
#    ex: [aws] - specifies aws credentials

[alicloud] section - specifies your Alibaba Cloud security credentials and default datacenter region. Alibaba Cloud region list

# [alicloud] SECTION REQUIRED if alicloud is listed in providers

[alicloud]
ali_region = cn-hangzhou
ali_access_key_id = EXCEWDYSWRP7VZOW
ali_access_key_secret = CHVsdhV+YgBEjJuZsJNstLGgRY43kZggNHQ

[aws] section - specifies your AWS security credentials and default datacenter region. Information on AWS Credentials

# [aws] SECTION REQUIRED if aws is listed in providers

[aws]
aws_access_key_id = EXCEWDYSWRP7VZOW4VAW
aws_secret_access_key = CHVsdhV+YgBEjJuZsJNstLGgRY43kZggNHQEh/JK
aws_default_region = us-west-1

[azure] section - specifies your Azure Tenant-ID, Subscription-ID, Application-ID and Application-Secret. Creating an Azure Service Principal

# [azure] SECTION REQUIRED if azure is listed in providers

[azure]
az_tenant_id = a3b7de99-6c36-e71f-e7d7-c5a1eefd9c01
az_sub_id = 2ac1b147-fdca-947c-4907-3f302a667100
az_app_id = ee16ad1d-d266-bffa-031c-008ab40d971e
az_app_sec = 22918C9e1cCC7665a+b3e4052f942630aE979CF68/v=

[gcp] section - supports two authentication types. Service Account is likely easier for many users, but both options are available. Specify the type of Authentication: (S)ervice or (A)pplication (defaults to service if not specified), Google Compute project-id, and the remaining variables required for the authentication type as described below. Information on Setting up Service Account Authentication

# [gcp] SECTION REQUIRED if gcp is listed in providers

[gcp]
gcp_auth_type = S
gcp_proj_id = sampleproject-634368
gcp_svc_acct_email = 12345678911-compute@developer.gserviceaccount.com
gcp_pem_file = SampleProject-72fcfdb29717.json

# gcp SUPPORTS TWO AUTHENTICATION TYPES:
#
#   gcp_auth_type - specifies which type to use ( S or A )
#       - if omitted, it defaults to Service Account Auth
#
#   S = Service Account Auth (default)
#       - requires that the service account key (json file) copied or moved to config dir
#    (the example above lists the values needed for Service Account Auth)
#
#   A = Installed Application Auth - when using this auth type:
#       - the first time the program is run with the proper credentials listed
#         - it displays a URL in the terminal session
#         - this URL must be pasted into a web-browser to display a code
#         - copy the code from the web browser and paste it into the terminal
#         - then program will then continue running
#
#  The example below lists the values needed for Installed Application Auth
#
#  [gcp]
#  gcp_auth_type = A
#  gcp_proj_id = sampleproject-634368
#  gcp_client_id = 12345678911-LZXcWZmyzU3v3qNPPJNEimoKgh9Wruo4.apps.googleusercontent.com
#  gcp_client_sec = t4ugvWTocssrVtX448tDEWBW

specifying multiple accounts - for one or more providers

#   Step 1
#    - add an additional entry to the 'providers' list - in this exact format:
#      - the entry begins with the standard values: aws, azure, gcp
#      - it is immediately followed by a numeric suffix
#          ex: aws2 (for a 2nd set of aws credentials)
#      - no additional characters are allowed or it will not be recognized and fail
#
#   Step 2
#    - add a section below of the same name containing the corresponding credentials
#      - ex: [aws2] (containing the 2nd set of aws credentials, for the earlier example)
#    - this new credentials section must include all credentials for the 2nd account,
#         even if some are the same as the primary account.

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

mcc-0.9.8.tar.gz (28.4 kB view hashes)

Uploaded Source

Built Distribution

mcc-0.9.8-py2.py3-none-any.whl (21.1 kB view hashes)

Uploaded Python 2 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