Skip to main content

Manages cloud_sql_proxy connections, allocating fixed ports and allowing control over starting and stopping

Project description

Cloud SQL Instance Manager

A command-line tool for managing GCP cloud_sql_proxy connections to a number of instances. It can automatically import your GCP project's Cloud SQL instances, assign ports to them, and start and stop the proxies.

Installation

Use the package manager pip to install cloud_sql_instance_manager.

pip install cloud_sql_instance_manager

You will need to have gcloud command line installed and logged in with gcloud auth login

Usage

Importing from gcloud

Ensure you are authenticated with gcloud command line.

cloud_sql import

The instance manager will import any (new) instances and automatically assign them ports.

If you want to specify a different project to your current default, then

cloud_sql import --project YOUR-PROJECT-NAME

Nicknames

By default, instances are given a nickname of everything proceeding "-instance-" in the full name. For example - test-application-instance-9956326571963535019 will get the nickname test-application You can amend the nickname with

cloud_sql update ORIGINAL-NICKNAME --nick NEW-NICKNAME

At any point, you can have more than one instance with the same nickname but different projects, and you can differentiate with --project PROJECT-NAME

Starting an instance

cloud_sql start NICK-NAME 

Stopping an instance

cloud_sql stop NICK-NAME 

Listing instances

List all instances

cloud_sql list 

List all instances for a project

cloud_sql list --project YOUR-PROJECT

List all running instances

cloud_sql list-running

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

TODO List

  • Export to DBeaver
  • Default instances - set and unset, start all default
  • Stop all

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

cloud_sql_instance_manager-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file cloud_sql_instance_manager-0.1.0.tar.gz.

File metadata

File hashes

Hashes for cloud_sql_instance_manager-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2ec6eadf8102ebdbbffcddb1055fed606cbc6ebe6bdcd9fb63846df543e1c206
MD5 bee9a524876c5570d17e528786953964
BLAKE2b-256 9b8a39516ebbc34fca644c43df27c1fab3cdd01151ae0826084757a51cba0b6f

See more details on using hashes here.

File details

Details for the file cloud_sql_instance_manager-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cloud_sql_instance_manager-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7d4f0af1202ca622d61dd247217507a07210938f0db5b4d3cc0ecb3d0897309
MD5 ece9d60f7ccc4e2e262d3d61e8529144
BLAKE2b-256 f77f3c350c3b4771d63d7ca63386ace015bbee115e1409fdaff2b97620f8c019

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