gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
17.67k stars 1.77k forks source link

Support more user-friendly UX for `tsh proxy aws` #44477

Open webvictim opened 4 months ago

webvictim commented 4 months ago

What would you like Teleport to do?

Support an --exec flag to tsh proxy aws to launch a new shell with the environment variables already set - similar to what https://github.com/gravitational/teleport/pull/40246 introduced for tsh proxy kube.

Alternatively/also, some kind of --output <filename> format would be useful to write the outputted variables to a file, so they can easily be picked up and sourced by folks who need the variables set in their environments, or for third-party tooling to read and use them. It's not currently easy to do this without a lot of text manipulation and shell scripting, and even then the experience is a little rough.

Related issue (feature request for JSON output format): https://github.com/gravitational/teleport/issues/39341

What problem does this solve?

Makes using tsh proxy aws (and thus AWS console access via Teleport) more usable and intuitive.

If a workaround exists, please include it.

Manually script something to run the proxy in the background, write the outputted variables to a file, trim whitespace, evaluate them etc... not fun.

greedy52 commented 3 months ago

FYI, you can do a single command today with tsh aws --exec.

--exec would be nice too for tsh proxy aws. we will look into adding it.