How can I autoscale instances based on Kafka topic lag?
CloudWatch is absolutely the way to go on this front, you can surface Kafka Metrics in CloudWatch either by:


Having a separate process that pushes the metrics into CloudWatch.
Have your Producers, Consumers or Stream Processors push the metrics you need into CloudWatch.


The process you follow will broadly be broken down into:


Publish Custom Metrics.
Create an AutoScaling Launch Configuration.
Create an AutoScaling Group and Policies based upon your Custom Metric.


Depending on your cost model I would also consider how you can use spot instances to keep the costs down, i.e. if you have non-critical but high compute workloads use Spot Instances as part of your autoscaling configuration.