Get an IAM user or role whose credentials are used to call the operation

aws sts

  • Security Token Service (STS) allows to request temporary credentials for (IAM) users or federated users.
    More information: <https://docs.aws.amazon.com/cli/latest/reference/sts/>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

aws sts get-caller-identity

click the source code to copy install aws sts on any operating system with command-not-found.com