AWS Builder Center
One AWS CLI Command I Run Before Every Deployment

One AWS CLI Command I Run Before Every Deployment

A quick habit that's saved me from deploying to the wrong AWS account more than once.

Hey There!
Before I run anything that touches real AWS resources, I always run one quick command first:
aws sts get-caller-identity
It shows exactly which AWS account, user, and role I'm currently authenticated as. Sounds simple, but when you're juggling multiple profiles (personal sandbox, free tier testing, a shared project account) it's really easy to accidentally run a command against the wrong account without realizing it.
I picked this habit up while testing AWS setups for a project of mine, after nearly deploying something to the wrong environment. Now it's just muscle memory: switch profile, run this command, confirm the account ID and ARN look right, then proceed.
Curious what others do.. does anyone else have a go-to sanity-check command before deploying or running anything destructive?
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article