Getting started
Once set up, this is your whole day: switch the terminal to an account and
type the aws commands you already know.
❯ cloudhop use acme-dev[ aws acme-dev (us-east-1) ]❯ aws ecs list-clusters❯ cloudhop use acme-prod[ aws acme-prod (us-east-1) PROD ]❯ aws s3 lsNo profile names, no --profile, no aws sso login. Three commands get you
there.
What you need
Section titled “What you need”- Node.js 20 or newer, to install cloudhop.
- AWS CLI v2. Don’t have it?
cloudhop doctoroffers to install it. - An AWS IAM Identity Center portal (a URL like
https://acme.awsapps.com/start) or a personal AWS account.
Set it up
Section titled “Set it up”-
Install cloudhop
Terminal window npm install --global cloudhopYou get two commands:
cloudhopand its short formhop. -
Add your accounts:
cloudhop addTerminal window cloudhop addChoose IAM Identity Center (SSO portal), paste your portal’s start URL (for example
https://acme.awsapps.com/start) and its region, and give it a short name such asacme.Choose Personal account (aws login) and a default region. See Personal accounts for what your user needs.
Choose AWS Emulator (local) or LocalStack or another local emulator and name it, for example
local. No sign-in, no AWS account: see Use a local emulator.Your browser opens: sign in as always and approve. cloudhop then lists every account and role you can use. Tick the ones you want and give each an alias, a short name with its own region:
◇ acme-production / AdministratorAccess◆ Alias (what you will type) acme-prod◆ Region for acme-prod us-east-1Have several portals? Run
cloudhop addonce per portal. -
Set up your terminal:
cloudhop shellTerminal window cloudhop shellIt asks, then adds one line to your shell’s startup file (
~/.zshrc,~/.bashrc, fish’sconfig.fishor your PowerShell profile). Open a new terminal afterwards. From then on, your terminal can:- switch accounts with
cloudhop use <alias>, and you type plainawsafter that; - sign you in by itself: an expired session opens the browser and
your
awscommand carries on; - protect production: on a production alias,
awsasks before anything that may change resources; - follow your projects: a folder with a
.cloudhoprcswitches to its alias when youcdinto it; - show the alias in your prompt, Starship included, so you always know which account you are in;
- complete aliases with Tab.
- switch accounts with
Work with aws as usual
Section titled “Work with aws as usual”cloudhop use acme-dev # this terminal is now acme-dev (or just `cloudhop use` to pick)aws sts get-caller-identity # who am I? acme-devaws ecs list-clusters # any aws command you know, unchangedterraform plan # Terraform, CDK and SDKs see it too
cloudhop use acme-prod # switch accountsaws s3 ls # now as acme-prodcloudhop use --off # back to no accountcloudhop use is the switch between accounts: it sets the alias’ account,
role and region in this terminal only. Other terminals keep theirs, so
you can have acme-dev in one tab and acme-prod in another. A new
terminal starts with no alias; to start every new one with the account you
use most, run cloudhop use acme-dev --default.
When a session expires
Section titled “When a session expires”Nothing to do. The next aws command renews the session silently or opens
your browser to sign in, then runs. Nothing checks your sessions in the
background.
Next steps
Section titled “Next steps”- Pin an account to each project with a
.cloudhoprc, socdswitches for you: Use an alias in your terminal. - Show the alias in your prompt (Starship included): See the alias in your prompt.
- One-off commands in another account without switching:
hop acme-qa s3 ls. See Use hop like the aws command. - Open the AWS console already signed in:
cloudhop console acme-dev s3. - Mark production aliases:
cloudhop prod acme-prod. - Teach your AI assistant:
cloudhop agent install. - Prefer a web page?
cloudhop ui.