![Forrest logo](/images/logo.png)
aws-sts:tldr:6199d
aws-sts: Get an IAM user or role whose credentials are used to call the operation.
$ aws sts get-caller-identity
try on your machine
The command aws sts get-caller-identity
is used to retrieve the identity of the AWS account or IAM user making the request. It provides information about the entity that is currently authenticated and accessing AWS services.
When you run this command, the AWS Security Token Service (STS) validates the credentials used to make the request and returns information about the caller's identity.
The response to this command includes the following details:
- Account: The AWS account ID of the authenticated entity.
- UserId: The identifier for the caller's IAM user or federated user.
- Arn: The Amazon Resource Name (ARN) of the authenticated entity.
By running this command, you can quickly obtain information about the caller's identity, which can be useful for auditing purposes or to verify who is invoking the AWS API operations.
This explanation was created by an AI. In most cases those are correct. But please always be careful and
never run a command you are not sure if it is safe.