Domanda

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.

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top