What does `aws sts get-caller-identity` return and why is it the first command you run?
BeginnerConceptGlobal Infrastructure and IAM Basics
Answer
It returns the UserId, Account and Arn of the credentials the CLI is currently using. It needs no IAM permission, so it never fails for authorization reasons, which makes it the universal "who am I and in which account" check.
$ aws sts get-caller-identity
{"UserId":"AROAEXAMPLE:alice","Account":"123456789012",
"Arn":"arn:aws:sts::123456789012:assumed-role/Admin/alice"}
An assumed-role ARN means temporary credentials; a bare user/ ARN means long-lived keys.
More on Global Infrastructure and IAM Basics
What is the difference between a Region, an Availability Zone and an edge location?BeginnerHow do you choose a Region for a workload?BeginnerWhat is the difference between an AZ name like `us-east-1a` and an AZ ID like `use1-az1`?IntermediateExplain the shared responsibility model.BeginnerWhat is the root user and how should you treat it?BeginnerWhat is the difference between an IAM user, group and role?Beginner