External monitoring integration with StatusCake
External monitoring is helpful because it gives insights on how performant your infrastructure is, as seen from the outside, maybe from many places in the world. We can build our own availability monitoring systems, or we can use third-party services. StatusCake is a good example for us as they have a good API and a free service tier for us to try with Terraform. We'll monitor two things: host latency and HTTP availability.
Getting ready
To step through this recipe, you will need the following:
A working Terraform installation
A StatusCake account (https://statuscake.com)
Optionally, an infrastructure managed by Terraform (refer to the previous recipes)
An Internet connection
How to do it…
Start by setting the new statuscake
provider, as we did with AWS or GitHub, using a username and API key:
provider "statuscake" { username = "${var.statuscake_username}" apikey = "${var.statuscake_apikey}" }
Declare the variables in variables.tf
:
variable "statuscake_username...