LoginSignup
0
0

[AWS]CLIでAmazon Linux2の最新のAMI IDを取得する

Posted at
aws ec2 describe-images \
  --region ap-northeast-1 \
  --owners amazon \
  --filters "Name=name,Values=amzn2*" "Name=state,Values=available" \
  --query "Images | sort_by(@, &CreationDate) | [-1].[ImageId]" \
  --output text

いつも、コンソールのEC2作成のところから取得していたので、CLIで一発で取得したいなと思い。

0
0
0

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
0