'Configures an Auto Scaling group to send notifications when
specified events take place.
:type autoscale_group: str or
:class:`boto.ec2.autoscale.group.AutoScalingGroup` object
:param autoscale_group: The Auto Scaling group to put notification
configuration on.
:type topic: str
:param topic: The Amazon Resource Name (ARN) of the Amazon Simple
Notification Service (SNS) topic.
:type notification_types: list
:param notification_types: The type of events that will trigger
the notification. Valid types are:
\'autoscaling:EC2_INSTANCE_LAUNCH\',
\'autoscaling:EC2_INSTANCE_LAUNCH_ERROR\',
\'autoscaling:EC2_INSTANCE_TERMINATE\',
\'autoscaling:EC2_INSTANCE_TERMINATE_ERROR\',
\'autoscaling:TEST_NOTIFICATION\''

def put_notification_configuration(self, autoscale_group, topic, notification_types):

    name = autoscale_group
    if isinstance(autoscale_group, AutoScalingGroup):
        name = autoscale_group.name
    params = {'AutoScalingGroupName': name, 'TopicARN': topic}
    self.build_list_params(params, notification_types, 'NotificationTypes')
    return self.get_status('PutNotificationConfiguration', params)
