https://github.com/webdevtodayjason/compute-connect
A streamlined Bash script for managing Google Cloud Platform (GCP) SSH connections, allowing users to easily set projects, list active instances, and connect with minimal effort.
https://github.com/webdevtodayjason/compute-connect
Last synced: 8 months ago
JSON representation
A streamlined Bash script for managing Google Cloud Platform (GCP) SSH connections, allowing users to easily set projects, list active instances, and connect with minimal effort.
- Host: GitHub
- URL: https://github.com/webdevtodayjason/compute-connect
- Owner: webdevtodayjason
- License: gpl-3.0
- Created: 2024-11-04T16:17:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-04T16:22:25.000Z (over 1 year ago)
- Last Synced: 2025-10-06T01:30:31.082Z (8 months ago)
- Language: Shell
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Project: Compute Connect
## Overview
`compute-connect` is a streamlined Bash script (`start.sh`) designed to simplify the process of managing SSH connections to Google Cloud Platform (GCP) compute instances. The script allows users to easily select a project, list active compute instances, and connect to a desired instance with minimal effort.
## Features
- Lists available GCP projects from a configuration file (`projects.config`).
- Enables selection of a project to set as the active project.
- Displays all active compute instances with numbering for easy selection.
- Facilitates SSH connections to the selected compute instance.
## Prerequisites
- [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) installed and configured on your local machine.
- Access to a GCP project with compute instances.
- A `projects.config` file containing a list of project IDs.
## Installation
1. Clone this repository:
```bash
git clone https://github.com/webdevtodayjason/compute-connect.git
cd compute-connect
```
2. Ensure `start.sh` has executable permissions:
```bash
chmod +x start.sh
```
3. Create a `projects.config` file in the same directory and add your project IDs, one per line:
```
another-project-id
another-project-id2
another-project-id65
another-project-id23
```
## Usage
Run the script using:
```bash
./start.sh
```
### Steps in the Script
1. **Project Selection**: The script reads the `projects.config` file and displays a numbered list of projects.
2. **Instance Listing**: Lists all active instances in the selected project, with numbering for easy reference.
3. **SSH Connection**: Prompts the user to select an instance by number and connects via SSH.
## Notes
- Ensure you have the necessary permissions to access the specified GCP projects and instances.
- Update the `projects.config` file as needed to add or remove project IDs.
## License
This project is licensed under the MIT License. See the `LICENSE` file for details.
## Contributing
Pull requests are welcome. For significant changes, please open an issue first to discuss what you would like to change.
## Author
Created by [Jason](https://github.com/webdevtodayjason).
## Acknowledgements
- Google Cloud Platform documentation
- [Bash Scripting Guide](https://www.gnu.org/software/bash/manual/)