EC2のインスタンス上でConsole上のタグ名を取得するワンライナー

aws ec2 describe-instances --instance-ids `curl -s http://169.254.169.254/latest/meta-data/instance-id` --query 'Reservations[].Instances[].{Name:Tags[?Key==`Name`].Value}' --output text | awk '{print $2}'
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.