https://github.com/morph027/aws-ssm-juggle
Interact with ECS tasks and EC2 instances through SSM
https://github.com/morph027/aws-ssm-juggle
Last synced: 5 months ago
JSON representation
Interact with ECS tasks and EC2 instances through SSM
- Host: GitHub
- URL: https://github.com/morph027/aws-ssm-juggle
- Owner: morph027
- License: mit
- Created: 2024-04-26T13:10:52.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-12T20:46:26.000Z (5 months ago)
- Last Synced: 2026-01-13T01:29:43.910Z (5 months ago)
- Language: Python
- Homepage:
- Size: 82 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aws-ssm-juggle
## Installation
```
pip install aws-ssm-juggle
```
## Pre-requisites
### [session-manager-plugin](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)
#### Linux
#### Repo
With updates (recommended): See [aws-session-manager-plugin](https://gitlab.com/packaging/aws-session-manager-plugin)
#### Manual
```bash
curl https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb -o "/tmp/session-manager-plugin.deb"
mkdir -p ~/bin
dpkg-deb --fsys-tarfile /tmp/session-manager-plugin.deb | tar --strip-components=4 -C ~/bin/ -xvf - usr/local/sessionmanagerplugin/bin/session-manager-plugin
```
#### MacOS
`brew install --cask session-manager-plugin`
### Infrastructure
Use [ecs-exec-checker](https://github.com/aws-containers/amazon-ecs-exec-checker) to check for the pre-requisites to use ECS exec.
## ecs-juggle
Inspired by [ecsgo](https://github.com/tedsmitt/ecsgo).
Provides a tool to interact with AWS ECS tasks.
Currently provides:
* interactive execute-command (e.g. shell)
* port-forwarding
You can supply command-line arguments to specify which cluster/service/task/... to use or will be prompted with a nice menu.
### Usage
See `ecs-juggle --help` for all features.
#### Execute command
Select all from menu:
```bash
ecs-juggle command
```
#### Port forwarding
Select all from menu:
```bash
ecs-juggle forward
```
Specify port and select the rest from menu:
```bash
ecs-juggle forward --remote-port 8080
```
## ec2-juggle
Inspired by [gossm](https://github.com/gjbae1212/gossm/).
Provides a tool to interact with AWS EC2 instances.
Currently provides:
* interactive shell (e.g. shell)
* ssh shell
* port-forwarding
### Usage
See `ec2-juggle --help` for all features.
#### Start session
```bash
ec2-juggle start
```
```bash
ec2-juggle start --document AWS-StartInteractiveCommand --command '{"command": ["sudo -i"]}'
```
#### Start ssh session
Default:
```bash
ec2-juggle ssh
```
With extra arguments:
```bash
ec2-juggle ssh --ssh-args="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -l ubuntu"
```
#### Copy files with scp
Default:
```bash
ec2-juggle scp --source '{instance}:/tmp/foo' --target './bar'
```
With extra arguments:
```bash
ec2-juggle scp --scp-args="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -l ubuntu" --source '{instance}:/tmp/foo' --target './bar'
```
#### Port forwarding
```bash
ecs-juggle forward --remote-port 80
```