AWS Cli Add Profile

Published
Length
3 min read

Luis Felipe Dias

All posts

To run an aws cli add profile setup, you store named account settings on your machine. You can set up static keys or link an identity provider for single sign-on. Most teams start by saving long-lived keys in local text files for each cloud account. When these profiles hold broad permissions, one mistake can wipe out production data. How the aws cli add profile workflow operates The command line tool reads two local files inside your home folder. One file holds secret keys, and the other file

AWS IAM Policies + CLI Authentication Patterns: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

To run an aws cli add profile setup, you store named account settings on your machine. You can set up static keys or link an identity provider for single sign-on. Most teams start by saving long-lived keys in local text files for each cloud account. When these profiles hold broad permissions, one mistake can wipe out production data.

How the aws cli add profile workflow operates

The command line tool reads two local files inside your home folder. One file holds secret keys, and the other file holds region and output preferences. When you add a profile, the tool writes a new named section into these files. Each section maps a profile name to an account role or a key pair. Engineers then pick a profile name for each command or set an active shell variable.

Teams can also link a profile to a single sign-on portal instead of static keys. In this flow, the tool opens a browser window so you can log in. After you log in, the cloud service sends a short-lived token to your local machine. The tool caches this token on disk and uses it to assume an account role. When the token expires, you must log in again to get a fresh session.

Why static profiles create security risks

Saving multiple profiles on a laptop makes daily cloud work much faster for engineers. Still, local secret files sit in plain text on the hard drive. Any script or bad app running under your user account can read those local files. If a laptop gets lost or stolen, those static keys give an attacker direct entry.

Even with single sign-on tokens, cached files remain exposed on the local disk until they expire. Engineers also tend to stay logged in to high-privilege profiles after an urgent fix ends. Running a destructive command against the wrong active profile is a common cause of outages. Rotating keys across dozens of team laptops takes hours of manual work each month.

AWS IAM Policies + CLI Authentication Patterns: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native cloud profiles solve and what they miss

Named profiles solve the problem of switching between test, staging, and production cloud accounts. They help engineers organize regions and roles without typing credentials for every single action. Pairing profiles with single sign-on also stops teams from sharing static keys in chat apps. Native cloud logs will record which role made an API call and when it happened.

Yet this native setup only decides who can log in to an account role. Once a session starts, the profile grants every permission attached to that cloud role. It cannot check or pause a dangerous command in flight before the cloud runs it. If a role allows database reads, the profile cannot mask emails or card numbers in results. Native profiles manage account entry, but they do not control individual commands during a session.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Where does the tool store local profile settings?

The tool stores settings and keys in a hidden folder inside your home directory. One file keeps secret keys, and a second file keeps regions and role settings.

Should teams use static keys or single sign-on for profiles?

Teams should use single sign-on profiles whenever possible instead of static keys. Single sign-on issues short-lived tokens, while static keys stay valid until someone deletes them.

How can an engineer switch between named profiles?

You can pass the profile name at the end of an individual command. You can also set a shell variable to keep one profile active for your terminal session.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.