# Show the Active AWS CLI Profile in iTerm2 with zsh Shell Colors

DevFeed: [Show the Active AWS CLI Profile in iTerm2 with zsh Shell Colors](<https://devfeed.tech/articles/oh-this-is-prod-18853.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/oh_this_is_prod/>)

Published: 2023-01-05T21:10:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Amazon Web Services](<https://devfeed.tech/topics/aws.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Shell](<https://devfeed.tech/topics/shell.md>), [Zsh](<https://devfeed.tech/topics/zsh.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Terminal](<https://devfeed.tech/topics/terminal.md>)

Tags: [aws](<https://devfeed.tech/tags/aws.md>), [cli](<https://devfeed.tech/tags/cli.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [terminal](<https://devfeed.tech/tags/terminal.md>)

## AI overview

This tutorial explains how to make the active AWS CLI profile visible by changing the iTerm2 shell profile according to the selected environment. It uses zsh hooks and an environment variable so development and production sessions are visually distinct, reducing the risk of running tests or commands against production.

## Source excerpt

I strongly believe that you should avoid connecting to production environments from local developer machines as much as possible. But sometimes, e.g. in order to analyse some specific kinds of failures, doing so can be inevitable. Now, if this is the case, I really, really want to be sure that I'm aware of the environment I am working in. I absolutely want to avoid a situation as in the catchy title of this post, when for instance you realize that you just ran some integration test against a production environment. In the context of working with the AWS CLI tool this means I'd like to be aware of the currently active profile by means of coloring my shell accordingly. Here's how I've set this up using iTerm2 and zsh.