aws AutoScaling

スポットインスタンスは、変動価格制のインスタンスで、たいていの時間帯は通常のインスタンスよりも圧倒的に低い価格で起動可能な代わりに、需給が逼迫すると値段が高騰し、もしあらかじめユーザーが指しておいた指値を上回ると突然terminateされる上、stopは存在せず、terminateしかできない、という実に個性的で魅力的なインスタンスです。

http://blog.hde.co.jp/entry/2015/02/12/175214

AWSマネジメントコンソールから設定
https://qiita.com/T0000N/items/ed39202999b7b1a5bdf3

参考
https://sys-guard.com/post-11684/

https://qiita.com/u1_9ma/items/88c6e77b92832e8474ef

https://qiita.com/iron-breaker/items/2b55da35429da7b19e49

https://qiita.com/tt2004d/items/1d8aed40b5798a6bbb4c

https://hirofukami.com/2010/03/05/amazon-ec2-auto-scaling/

http://blog.kenjiskywalker.org/blog/2013/08/14/aws-vpc-autoscaling/

terraform AutoScaling

https://christina04.hatenablog.com/entry/2016/01/21/122437

TerraformでのAutoScale時のハマりどこ
端的にいうとこの2つです。

Terraform経由で実行した際のLaunchConfiguration(イカLC)とAutoScalingGroup(イカASG)の削除の順番が逆
LC内のuser_data更新で一網打尽になる

http://akuwano.hatenablog.jp/entry/20150625/1435230668

つまり、Auto Scalingのように運用に曝されることで状態が変化しうる性質を持つものに関しては、Terraformで管理するのはなかなか難しいということがわかります。そのため、今のプロジェクトにおいてはAuto Scaling Groupの起動構成だけをTerraform管理にし、Auto Scaling Groupの作成・破棄・操作に関しては別途Goでツールを書いて運用しています。

https://blog.stormcat.io/post/entry/selective-terraform-operation/

aws_launch_configuration のみ

https://www.terraform.io/docs/providers/aws/d/launch_configuration.html