ecsgo icon indicating copy to clipboard operation
ecsgo copied to clipboard

Allow to define "host", "portNumber", "localPortNumber" during port forwarding session

Open otbe opened this issue 1 year ago • 2 comments

Hello,

first of all ecsgo is a great tool and really improves quality of (engineer) life a lot :)

I wonder if it would be possible to allow specifying all 3 values after the selection of specific container. This way one could use ecsgo --forward to also tunnel via the container to a database instance which is only accessible to the container itself. So basically using the container as a jumphost.

Something like this works very well:

 aws ssm start-session --target ecs:<cluster>_<taskId>_<runtimeId> --document-name AWS-StartPortForwardingSessionToRemoteHost --parameters '{"host":["my-postgres-database.internal"],"portNumber":["5432"], "localPortNumber":["5432"]}'

otbe avatar Oct 15 '24 11:10 otbe

Hey @otbe! Thank you so much! and thank you for opening this issue (suggestion) 😄

Perhaps a --remote option which specifies that this is a remote-forward session? As well as accompanying --remote-host and --remote-port options.

If --remote is a blank value, then we can prompt the user for the remote-host and remote-port after selecting the task (this is the same way we do it for --forward if --local-port is not specified)

Let me know your thoughts!

tedsmitt avatar Oct 15 '24 19:10 tedsmitt

Sounds like a really good way to implement this 👍

otbe avatar Oct 16 '24 06:10 otbe