This repository has been archived. You can find a more up-to-date approach in my pipeline-example and deployment-pipeline repositories.
An example of how to deploy a Lambda function automatically using CodePipeline and Terraform.
Discussion on my site here.