Granted CLI Workspaces #7
Replies: 3 comments
-
This proposal solves at least one of the key bits of missing functionality that I would like to see, and it's a big one/good one. My use case of late has been developing Glue jobs (Spark), typically in the same development environment/account. I open FF using In addition, I have command line sessions, e.g. Jupyter notebook, running AWS CLI, utilities like Current browser support is challenging in the morning after sessions have timed out. I haven't found a way to refresh the session and re-login each of the open tabs. Seems like I have to close the browser and start over with a new session. I may be missing something simple, like perhaps using the start url login in that browser. I sometimes have to open other AWS resources in separate accounts, such as RDS, Redis, EKS in production. It feels like these want to open in a separate browser window -- I had experimented with Chrome profiles for a short time, where the profile theme was different depending on environment -- green for dev, yellow for staging, red for production. Switched between these with Meanwhile, back at the command line I have been struggling with
but not In normal usage, shortcuts from our utility like With standard AWS SSO login, we have access to all our accounts, so just setting a profile linked to that account, via env var, handles most of the command-line cases we use. Occasionally, some software or setup will also need the AWS session variables (access keys, and session token), but mostly things know to look in the With current granted login, something seems to conflict with my setup. It seems as though So in this world, my wish list:
Hope this is useful feedback and context! |
Beta Was this translation helpful? Give feedback.
-
A tangential discussion point to add, and something I plan on raising a separate RFD for, is that it would be great to be able to use Granted for loading secrets into environment variables. For example, if
and have Workspaces could also export non-secret variables, similar to @tomharrisonjr's example above exporting |
Beta Was this translation helpful? Give feedback.
-
On command names, I'm for the idea of having
If a user happens to have a profile called
(and if for any reason a user happens to have a profile called |
Beta Was this translation helpful? Give feedback.
-
Background
Granted CLI makes working with the AWS in the browser and the terminal easy, it changed the way we work at Common Fate. Now as we are building our new products, I considered how I could extend Granted to improve more of my daily development workflow.
Proposal
My proposal is to setup what I’m calling “workspaces” for the Granted CLI which leverage the existing browser capabilities and make software development easier.
For example, Alice is a web app developer who frequently works on features that need to be tested by 2 user types, say an admin and a regular user. To test this in local dev, Alice use 2 seperate browsers, or sometimes an incognito tab, then logs into a different account on each one. This works fine, but there is a need to switch between windows, and when you close the incognito browser, the session is lost.
With “workspaces”, Granted CLI would allow Alice to run a command to automatically open Firefox with 2 containers, one for the user and one for the admin directly to the http://localhost:3000/ server that she’s developing on. After logging in once, the browser can be closed and the workspace relaunched with the user sessions persisted in each container.
Now extend this idea, [Open a CLI and a console at the same time with a one liner](common-fate/granted#280) is one suggestion. Another use case is launching multiple console sessions with a single command. You could setup a profile which assumes the developer role, exports credentials to .env and opens the console up to any relevant web pages you need for that task.
You may have an incident response workspace or observability workspace, which will open up a range of console sessions and any web apps of dashboards that you usually need in Firefox containers side by side. If you need to request access and you are using Granted Approvals, you would be given the links required to request access.
For me, it would be amazing to have a one liner,
assume -w approvals-dev
thatI think for convenience we should also look at adding supporting launching multiple profiles via
assume
e.gassume -c profile1 profile2
Proposed Commands
Launching a workspace
You should be able to launch a workspace with either granted or assume, though you need to use assume if the workspace exports credentials to the terminal environment. We could reduce this to only the assume command, however I feel like theres no reason to only have it as a flag on assume.
granted workspaces <name>
granted w <name>
assume -w <name>
required for profiles which export credentials to the current terminal, but otherwise the same as the granted commandConfigure a workspace
configuration should be via the TOML file and can be edited using the CLI
granted workspaces add
granted w update
granted w remove
granted w list
Workspaces should be able to have descriptionsFor Discussion
Beta Was this translation helpful? Give feedback.
All reactions