Show EC2 instance tags for all instances
Show EC2 instance tags from single AWS account
$ aws ec2 describe-instances | jq -r '.Reservations[].Instances[].Tags | reduce .[] as $i ({}; .[$i.Key] += $i.Value) | [.Name, .Env, .Service, .Role] | @csv'
"xxx-prod-web1",,,"web"
"xxx-prod-web2","prod","xxx","web"
"yyy-prod-web1","prod","yyy","web"
"yyy-prod-web2","prod","yyy","web"
"zzz-work",,,"ope"
"xxx-prod-batch1","prod","yyy","batch"
Show EC2 instance tags from multiple AWS accounts
$ ./run-aws-cli-on-multiple-acconts -r administrator -c "ec2 describe-instances" -j '.Reservations[].Instances[].Tags | reduce .[] as $i ({}; .[$i.Key] += $i.Value) | [.Name, .Env, .Service, .Role] | @csv'
account1 arn:aws:iam::123456789012:role/qwert-administrator-role
"xxx-prod-web1",,,"web"
"xxx-prod-web2","prod","xxx","web"
"yyy-prod-web1","prod","yyy","web"
"yyy-prod-web2","prod","yyy","web"
"zzz-work",,,"ope"
"xxx-prod-batch1","prod","yyy","batch"
account2 arn:aws:iam::234567890123:role/qwert-administrator-role
"aaa-prod-web1",,,"web"
"aaa-prod-web2","prod","xxx","web"
...
See https://github.com/takah/run-aws-cli-on-multiple-accounts for run-aws-cli-on-multiple-acconts
script.