Created
August 14, 2016 15:01
-
-
Save mwnorman/fb71f8b010a17e69a96381f5188e166d to your computer and use it in GitHub Desktop.
parse aws iam arn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
aws --profile $1 iam get-user | jq '.User | {accountName: .UserName, accountId : .Arn | match("(arn:aws:iam::)(\\d{12})").captures[1].string }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment