inscapist / terraform-k3s-private-cloud

Private cluster with k3s. Why have 1 huge complicated cluster (pet) when you can have many simple, cheap clusters (cattle)?
MIT License
114 stars 14 forks source link

Add port tunneling capability to GoSSM #9

Closed inscapist closed 3 years ago

inscapist commented 3 years ago

GoSSM is a nice project because it adds more ease of use to the project.

However, it currently does not support port tunneling yet.

https://github.com/gjbae1212/gossm

inscapist commented 3 years ago

As a reference, allowing a local only port (not bound to 0.0.0.0) to be accessible locally, using RDS as example:

In the first session, use socat to forward traffic from localhost:5432 to RDS

aws ssm start-session --target i-0d9baeda74bb88366

# within the instance,
sudo socat TCP4-LISTEN:5432,fork TCP4:cms-database.c5k0aeaxnuu7.ap-southeast-1.rds.amazonaws.com:5432

In the second session, run

aws ssm start-session --target i-0d9baeda74bb88366 \
  --document-name AWS-StartPortForwardingSession \
  --parameters '{"portNumber":["5432"],"localPortNumber":["15432"]}'
inscapist commented 3 years ago

This feature is implemented since v1.3.3