Skip to content

Instantly share code, notes, and snippets.

@niko-dunixi
Created September 30, 2021 15:41
Show Gist options
  • Save niko-dunixi/002b967b5853fb3c0145013236a5374d to your computer and use it in GitHub Desktop.
Save niko-dunixi/002b967b5853fb3c0145013236a5374d to your computer and use it in GitHub Desktop.
AWS Cli Snippets

Get Account ID

$ aws sts get-caller-identity --query Account --output text

Get Current IAM User ARN

$ aws sts get-caller-identity --query Arn --output text

Get Current IAM User Name

$ aws sts get-caller-identity --query Arn --output text | sed 's/.*\///g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment