I have an custom AMI and want to run certain config commands at initial boot, depending on the autoscale instance that starts it. How do I do this?
If I am understanding you correctly, you have one AMI used in several autoscaling groups and want to run a specific “bootstrap” sequence on it depending on the autoscaling group it belongs to.

This is not difficult to accomplish because the launch configuration you created to map the autoscaling group to the AMI can accomodate user data which can be a shell script.

In the shell script provided as user data, it is customary to retrieve meta data so that the instances can correctly identify itself in logs and arrange other similar last minute details.  This meta-data could also contain a reference to the auto-scaling group, which you could take advantage of to reduce the little overhead due to autoscaling-group management.