GUIから作るのに疲れた人向けです。
vim /root/.bash_profile
---
export AWS_ACCESS_KEY={access_key}
export AWS_SECRET_KEY={secret_key}
export EC2_URL=ec2.ap-northeast-1.amazonaws.com
---
を追加して
source /root/.bash_profilevim launch_micro.sh
---
#/bin/sh
instanceName=$1
result_id=`ec2-run-instances ami-c9562fc8 -t t1.micro -z ap-northeast-1c -b '/dev/sda1=snap-745bd495:30' -k {key} -g {group} | grep INSTANCE | sed 's/^INSTANCE\s\+//g' | sed 's/\s.*$//g'`
echo "instance_id: $result_id created !"
if [ "$result_id" = "" ]; then
echo "instance_id not found ..."
exit 1
fi
if [ "$instanceName" != "" ]; then
ec2-create-tags $result_id --tag="Name=${instanceName}"
fi
---ami-c9562fc8はAmazonLinux
snap-745bd495は現在のデフォルトのEBSボリューム
30はEBSのサイズを30GBで指定しています。


