Skip to content

Commit 60c2905

Browse files
author
Kuba Niechciał
committed
[DOC] add ec2 & elasticache example usecase
1 parent f4758d5 commit 60c2905

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,29 @@ ENV['ssh-tunnel'] = {
159159

160160
NOTE: at this time, this plugin does not support setting a path to `privateKeyPath` to a key that has been encrypted with a password.
161161

162+
## AWS ElastiCache & EC2 Example
163+
One of the common use cases for `ember-cli-deploy-ssh-tunnel` is need to connect to ElastiCache that is accessible only from EC2 instance. To deploy your `index.html` to ElastiCache you need:
164+
* username and host you can SSH into your EC2 instance (e.g. `deploy@my-ec2-instance.amazon.com`)
165+
* host and port of your ElastiCache that is accessible from this EC2 instance (e.g. `my-elasticache-instance.amazon.com:6379`)
166+
167+
First, you should confirm that ssh tunneling actually works on your localhost, try:
168+
169+
```
170+
$ ssh -f -N -L6379:my-elasticache-instance.amazon.com:6379 deploy@my-ec2-instance.amazon.com
171+
$ redis-cli
172+
```
173+
174+
You should be able to see Redis CLI connected to your ElastiCache instance.
175+
176+
If it works, set following configuration in `ssh-tunnel`:
177+
178+
1. Set `host` to your EC2 instance (e.g. `my-ec2-instance.amazon.com`)
179+
2. Set `username` to your EC2 user (e.g. `deploy`)
180+
3. Set `dstHost` to your ElastiCache instance (e.g. `my-elasticache-instance.amazon.com`)
181+
4. Set `dstPort` to your ElastiCache port (e.g. `6379`)
182+
183+
In `redis` config leave `host` and `port` as default - thanks to ssh tunneling your `localhost:6379` will point to `my-elasticache-instance.amazon.com:6379` via `my-ec2-instance.amazon.com`.
184+
162185
## Running Tests
163186

164187
1. `npm install`

0 commit comments

Comments
 (0)