Can AWS autoscaling invoke custom code when scaling up or down instances? In other words, given the pre-existence of some arbitrary launch_instance.sh script that launches and configures one's instances, can that be integrated into the autoscaling workflow?

I believe the answer to this question is "no, you need to bake the things that launch_instance.sh does into an AMI and execute that when the instance launches", but I'd appreciate confirmation in case I missed some documentation.

有帮助吗?

解决方案

You can actually set that up in userdata within the launch configuration. Some AMI's have cloudinit and will execute userdata automatically, but otherwise you can bake something into the AMI that will check the instance metadata for userdata.

More information about Cloudinit: https://help.ubuntu.com/community/CloudInit

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top