Skip to content

Use with other tools

Your aliases work far beyond hop. There are two ways to use them elsewhere.

Every alias of a company portal is a profile in ~/.aws/config with the same name, so anything that understands AWS profiles can use it:

Terminal window
aws s3 ls --profile acme-prod
AWS_PROFILE=acme-prod terraform plan
AWS_PROFILE=acme-prod npm run deploy # an app using the AWS SDK

In Terraform:

provider "aws" {
profile = "acme-prod"
}

In the AWS Toolkit for VS Code or JetBrains, pick the profile from the list.

For a personal account the profile is cloudhop-<source name> (for example cloudhop-personal), the one aws login signs in to.

The tool reads the session cloudhop saved. If it has expired, run any hop command or cloudhop login acme to renew it, then try again.

cloudhop exec runs any command with the alias’ temporary credentials in the environment, and renews the session first if needed:

Terminal window
cloudhop exec acme-prod -- terraform apply
cloudhop exec acme-prod -- python deploy.py
cloudhop exec acme-prod --region eu-west-1 -- cdk deploy

The command receives AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION and AWS_DEFAULT_REGION. Use this for tools that don’t read profiles, or when you want a sign-in guaranteed before a long run.

Situation Use
Interactive work with the AWS CLI hop acme-prod ...
Tools that support profiles (Terraform, SDKs, IDEs) AWS_PROFILE=acme-prod or the tool’s profile setting
Tools that only read environment variables cloudhop exec acme-prod -- ...
A long job that must not fail on an expired session cloudhop exec acme-prod -- ...