def delete_sns_topic(): """ Deletes the SNS topic. Subscriptions must be deleted prior to that. """ con = SNSConnection(aws_secret_access_key=AWS_SECRET_ACCESS_KEY, aws_access_key_id=AWS_ACCESS_KEY, region=RegionInfo(name=REGION, endpoint='sns.%s.amazonaws.com' % REGION)) topic_arn = get_topic_arn() print "Deleting topic : %s" % topic_arn con.delete_topic(topic_arn) con.close()