LoginSignup
0

More than 5 years have passed since last update.

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

Last updated at Posted at 2018-04-03
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}'

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0