Difference between revisions of "Aws sts get-caller-identity"

From wikieduonline
Jump to navigation Jump to search
Line 4: Line 4:
 
* https://docs.aws.amazon.com/cli/latest/reference/sts/get-caller-identity.html
 
* https://docs.aws.amazon.com/cli/latest/reference/sts/get-caller-identity.html
  
 +
 +
ACCOUNT_ID=$(aws sts get-caller-identity --output text --query 'Account')
  
 
<code>[[aws sts]] get-caller-identity</code>
 
<code>[[aws sts]] get-caller-identity</code>

Revision as of 01:35, 17 February 2022

The aws sts get-caller-identity command outputs three pieces of information including the ARN.


ACCOUNT_ID=$(aws sts get-caller-identity --output text --query 'Account')

aws sts get-caller-identity


aws sts get-caller-identity
{
    "UserId": "ZIDBZCTGOUKVXXFNQ5Q3F",
    "Account": "894058868389",
    "Arn": "arn:aws:iam::894058868389:user/your_user"
}

Related

See also

Advertising: