Company SSO portals
Most companies give access to AWS through an IAM Identity Center portal
(formerly AWS SSO). It has a start URL like https://acme.awsapps.com/start:
the page you open to see your accounts.
Add a portal
Section titled “Add a portal”cloudhop add- Choose IAM Identity Center (SSO portal).
- Paste the start URL. Copy it from the browser when you are on your portal’s account list, or ask your administrators.
- Enter the SSO region: the region where your company set up Identity
Center.
us-east-1is the most common; your administrators know it. - Give the portal a short name (cloudhop suggests one from the URL, such
as
acme). You will see it incloudhop lsand use it in commands likecloudhop login acme.
The browser opens, you sign in and approve, and cloudhop lists every account and role you can use. Pick the ones you want and give each an alias and a region (see Aliases and regions).
Several portals
Section titled “Several portals”Add as many as you need: run cloudhop add again for each one. Each portal has
its own session, so signing in to one doesn’t affect the others.
cloudhop lsacme AWS · https://acme.awsapps.com/start ● session valid ALIAS REGION ACCOUNT / ROLE acme-prod us-east-1 acme-production / AdministratorAccess acme-dev us-east-2 acme-development / Developer
globex AWS · https://globex.awsapps.com/start ○ expired, opens the browser on next use ALIAS REGION ACCOUNT / ROLE globex-qa eu-west-1 globex-qa / ReadOnlySessions and renewal
Section titled “Sessions and renewal”How long a session lasts is set by your company in Identity Center (often 8 to 12 hours). cloudhop handles it like this:
- Valid: commands run straight away.
- Renewable: the session expired but can be renewed without the browser; cloudhop does it silently on the next command.
- Expired: the next command opens the browser. After you sign in, cloudhop refreshes the accounts and roles of that portal and runs your command.
To sign in on purpose, for example before going offline:
cloudhop login acmeKeep the account list up to date
Section titled “Keep the account list up to date”When you get access to a new account, it shows up after the next sign-in. To refresh now:
cloudhop sync # every portalcloudhop sync acme # one portalIf an account or role you had an alias for disappears, cloudhop sync tells
you and cloudhop ls marks the alias as no longer available.
No browser on this machine?
Section titled “No browser on this machine?”On a remote server (over SSH) the browser can’t reach cloudhop. Use the device code flow: cloudhop prints a URL and a code you confirm from any device.
cloudhop login acme --device-codeSet CLOUDHOP_DEVICE_CODE=1 to always use it on that machine.
What cloudhop writes
Section titled “What cloudhop writes”A block in ~/.aws/config, and nothing outside it:
# >>> cloudhop managed >>> (edit with `cloudhop`, not by hand)[sso-session cloudhop-acme]sso_start_url = https://acme.awsapps.com/startsso_region = us-east-1sso_registration_scopes = sso:account:access
[profile acme-prod]sso_session = cloudhop-acmesso_account_id = 123456789012sso_role_name = AdministratorAccessregion = us-east-1# <<< cloudhop managed <<<The session token goes where the AWS CLI expects it (~/.aws/sso/cache), so
aws --profile acme-prod ... works too, and so do
other tools.
Remove a portal
Section titled “Remove a portal”cloudhop rm acmecloudhop asks before removing a portal, because its aliases go with it.