https://github.com/stefansundin/ec2-run
Run rails consoles (and other things) on ec2 instances. :computer:
https://github.com/stefansundin/ec2-run
aws ec2 ssh
Last synced: 2 months ago
JSON representation
Run rails consoles (and other things) on ec2 instances. :computer:
- Host: GitHub
- URL: https://github.com/stefansundin/ec2-run
- Owner: stefansundin
- Created: 2016-11-23T06:14:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-17T18:54:57.000Z (over 8 years ago)
- Last Synced: 2025-02-13T05:15:38.628Z (8 months ago)
- Topics: aws, ec2, ssh
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ec2-run
Use this tool to easily connect to an EC2 server and run a rails console on it
(or whatever command you specify).Note: What you run using this tool will be run on the EC2 server you select,
so if you run a destructive action on a production server, you will break that
production server.Invoke with `-t` to start a tmux session on the remote server. For a tutorial on
tmux, see: https://danielmiessler.com/study/tmux/## Install
You can install this tool by using [our Homebrew tap](https://github.com/Fullscreen/homebrew-tap):
```shell
brew tap fullscreen/tap
brew install ec2-run
```## ProTips
### Stack name
This tool assumes that you want to run commands on EC2 instances that are
launched from CloudFormation stacks, so it looks up instances based on the tag
`tag:aws:cloudformation:stack-name`.If you don't specify `-s`, the tool will try to figure out a stack name from
your git remotes, but you can set a git config to override that.```bash
$ git config --local ec2-run.stack stage-datascience
```Now if you omit the `-s` flag, `stage-datascience` will automatically be used.
Revert with:
```bash
$ git config --local --unset ec2-run.stack
```### Use tmux by default
```bash
$ git config --global ec2-run.tmux true
```Revert with:
```bash
$ git config --global --unset ec2-run.tmux
```## Contribute
To download and hack on the source code, run:
```
$ go get -u github.com/Fullscreen/ec2-run
$ cd $GOPATH/src/github.com/Fullscreen/ec2-run
$ go build
```