0
0

More than 1 year has passed since last update.

#5 AWS CLIでAMIを作成する

Last updated at Posted at 2023-07-05

はじめに

AWS CLIでAMIを作成します。構成図は以下の通りです。
ami.png

手順

設定値の指定

#インスタンスIDの指定
INS_ID="i-xxxx "
#インスタンス名の指定
INS_NAME="cli_ami"

設定値の確認

cat << END

INS_ID="i-xxxx"
INS_ID="${INS_ID}"

INS_NAME="cli-ami"
INS_NAME="${INS_NAME}"

END

処理の実行

  • create-imageコマンドを使います。
  • no-rebootオプションを指定することで、AMI作成時にEC2の再起動を設定をオフにします。
aws ec2 create-image \
    --instance-id ${INS_ID} \
    --name ${INS_NAME} \
    --no-reboot

【参考】AMI 作成時に意図しない再起動がありました。なぜでしょうか?

#7 作成したAMIから2つ目のEC2インスタンス起動

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