Gossy is a versatile AWS CLI tool designed for efficient management across AWS services. It simplifies connecting to EC2 instances via SSM and setting up port forwarding to RDS instances.
- AWS Profile Management: Easily select and switch between AWS profiles
- EC2 Instance Connection: Connect to EC2 instances using AWS Systems Manager (SSM)
- ECS Pod Connection: Connect to ECS containers with cluster/task/container selection
- RDS Port Forwarding: Set up port forwarding to RDS instances through EC2 instances
- Real-time Command Display: View AWS commands as you make selections (optional with
-Hflag) - Session Management: Remember your last session for quick reconnection
- Interactive CLI: User-friendly interface with interactive prompts
Install via Homebrew:
brew tap mangchhe/gossy
brew install gossy- AWS CLI installed and configured with profiles
- AWS Systems Manager (SSM) agent installed on your EC2 instances
- For ECS connections: ECS Exec enabled on your ECS tasks and services
- Appropriate IAM permissions for:
- SSM and RDS access (for EC2 connections)
- ECS Exec permissions (for ECS connections)
ecs:ExecuteCommand,ecs:DescribeTasks,ecs:DescribeClusterspermissions
To use Gossy, you need to have AWS profiles configured. Here's how to set them up:
-
Install the AWS CLI if you haven't already:
brew install awscli
-
Configure your AWS profiles:
aws configure --profile myprofile
You'll be prompted to enter:
- AWS Access Key ID
- AWS Secret Access Key
- Default region name (e.g., ap-northeast-2)
- Default output format (e.g., json)
-
You can set up multiple profiles by repeating the command with different profile names:
aws configure --profile another-profile
-
Verify your profiles:
aws configure list-profiles
Your profiles will be stored in ~/.aws/credentials and ~/.aws/config files.
Simply run the command:
gossyThis will:
- Show a list of your AWS profiles
- Allow you to select a service type (EC2 Instance or ECS Pod)
- Choose your target (EC2 instance or ECS cluster/task/container)
- Select connection type (SSM connection or DB port forwarding)
To see the AWS commands that will be executed as you make selections:
gossy -H
# or
gossy --historyThis displays real-time command updates below the header as you navigate through options.
Example Output (Click to expand)
~ gossy -H
██████╗ ██████╗ ███████╗███████╗██╗ ██╗
██╔════╝ ██╔═══██╗██╔════╝██╔════╝╚██╗ ██╔╝
██║ ███╗██║ ██║███████╗███████╗ ╚████╔╝
██║ ██║██║ ██║╚════██║╚════██║ ╚██╔╝
╚██████╔╝╚██████╔╝███████║███████║ ██║
╚═════╝ ╚═════╝ ╚══════╝╚══════╝ ╚═╝
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Profile: development │ Service: None │ Mode: Interactive │ Version: v1.0.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Command: aws ssm start-session --profile development
? Select an AWS Profile: [Use arrows to move, type to filter]
> Connect with Last Session
development
production
staging
? Select service type: [Use arrows to move, type to filter]
> EC2 Instance
ECS Pod
? Select an EC2 Instance: [Use arrows to move, type to filter]
> app-server-1 (i-0a1b2c3d4e5f67890) - 🟢 running
app-server-2 (i-0123456789abcdef0) - 🟢 running
db-bastion (i-abcdef0123456789) - 🟢 running
Command: aws ssm start-session --profile development --target i-0a1b2c3d4e5f67890
? Select connection type: [Use arrows to move, type to filter]
> Instance (SSM)
DB (Port Forwarding)
ECS Connection Example:
? Select service type: [Use arrows to move, type to filter]
EC2 Instance
> ECS Pod
? Select an ECS Cluster: [Use arrows to move, type to filter]
> my-app-cluster
staging-cluster
prod-cluster
Command: aws ecs execute-command --profile development --cluster my-app-cluster
? Select a Task: [Use arrows to move, type to filter]
> my-app/my-app-task-def (12345678) - 🟢 RUNNING
my-worker/worker-task-def (87654321) - 🟢 RUNNING
Command: aws ecs execute-command --profile development --cluster my-app-cluster --task 12345678
? Select a Container: [Use arrows to move, type to filter]
> my-app-container - 🟢 RUNNING
sidecar-container - 🟢 RUNNING
Command: aws ecs execute-command --profile development --cluster my-app-cluster --task 12345678 --container my-app-container --interactive --command /bin/sh
To quickly reconnect to your last session:
gossyThen select "Connect with Last Session" from the profile menu.
To explicitly select a profile:
gossy profileThis command skips the "Connect with Last Session" option and shows all your AWS profiles alphabetically.
Gossy uses:
- AWS SDK for Go to interact with AWS services
- AWS SSM to establish secure connections to EC2 instances
- AWS ECS Exec to connect to ECS containers
- Port forwarding through SSM to connect to RDS instances
- Real-time command generation and display as you navigate options
- Local storage to remember your last session
gossy- Run with minimal UI (no command display)gossy -Horgossy --history- Run with real-time command display- Commands are updated live as you make selections through the interface
- Go 1.16 or higher
- AWS SDK for Go v2
git clone https://github.com/mangchhe/gossy.git
cd gossy
go buildThis project is licensed under the MIT License - see the LICENSE file for details.