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/bash | |
## get current sts details | |
set -e | |
sts=$(aws sts get-caller-identity --profile $1) | |
date | |
echo """Current Identity: | |
$sts | |
""" | |
account=$(echo $sts | jq -r .Arn | awk '{split($0, a, ":"); print a[5]}') | |
role=$(echo $sts | jq -r .Arn | awk '{split($0, a, ":"); print a[6]}' | awk '{split($0, a, "/"); print a[2]}') |