Managing Heroku apps and add-ons using Terraform
Heroku is a popular Platform-as-a-Service (PaaS), where you have absolutely no control over the infrastructure. But even for such platforms, Terraform can automate and manage things for you, so Heroku can do the rest. We'll create an app (a simple GitHub Hubot: http://hubot.github.com/), but feel free to use your own. On top of this app, we'll automatically plug a Heroku add-on (redis) and deploy everything.
Getting ready
To step through this recipe, you will need the following:
A working Terraform installation
A Heroku account (https://www.heroku.com/)
An optional Slack Token
An Internet connection
How to do it…
First things first: we need to define the Heroku provider. It consists of an e-mail address and an API key. Let's create generic variables for that in variables.tf
:
variable "heroku_email" { default = "[email protected]" description = "Heroku account email" } variable "heroku_api_key" { default = "12345" description = "Heroku...