This was originally built to show case how Jenkins pipelines could be used to create a terraform workflow. You can see a copy of the presenation here
This was written in 2017 and is an out dated use of both Jenkins and Terraform both of which have progressed and support some of this more natively.
Feel free to read it/use at your own will :)
Both the main.tf
and Jenkinsfile
are pretty well documented.