Custom metric alarm function Amazon Cloudwatch
An alarm can only publish to an SNS topic but there are a number of ways to subscribe to that topic.  You can get an SMS message, get email, or you can have your own program called via HTTP or HTTPS.  You would have to write a small web application that listens for the SNS messages and then perform whatever action you want.  Or you could subscribe an SQS queue to the SNS topic and then have your program poll the SQS queue waiting for messages.
I am playing around with boto and Amazon EC2 instances. I am able to create an alarm on a metric for cpu utilisation that sends an email via an SNS Topic. However what I would like to do is call a function in my code when the alarm is triggered to launch a new instance. I don't see a way of placing anything besides an ARN string on an alarm action? Does anyone have any ideas? Thanks