variable "pingdom_user" {}
variable "pingdom_password" {}
variable "pingdom_api_key" {}
variable "pingdom_account_email" {}
variable "apps_dns_zone_name" {}
variable "env" {}
variable "contact_ids" {}

provider "pingdom" {
    user = "${var.pingdom_user}"
    password = "${var.pingdom_password}"
    api_key = "${var.pingdom_api_key}"
    account_email = "${var.pingdom_account_email}"
}

resource "pingdom_check" "paas_http_healthcheck" {
    type = "http"
    name = "PaaS HTTPS - ${var.env}"
    host = "healthcheck.${var.apps_dns_zone_name}"
    encryption = true
    resolution = 1
    uselegacynotifications = true
    sendtoemail = true
    sendnotificationwhendown = 2
    contactids = ["${split(",", var.contact_ids)}"]
}

resource "pingdom_check" "paas_db_healthcheck" {
    type = "http"
    name = "PaaS DB - ${var.env}"
    host = "healthcheck.${var.apps_dns_zone_name}"
    url  = "/db"
    encryption = true
    resolution = 1
    uselegacynotifications = true
    sendtoemail = true
    sendnotificationwhendown = 2
    contactids = ["${split(",", var.contact_ids)}"]
}

variable "pingdom_user" {}
variable "pingdom_password" {}
variable "pingdom_api_key" {}
variable "pingdom_account_email" {}
variable "apps_dns_zone_name" {}
variable "env" {}
variable "contact_ids" {}

provider "pingdom" {
    user = "${var.pingdom_user}"
    password = "${var.pingdom_password}"
    api_key = "${var.pingdom_api_key}"
    account_email = "${var.pingdom_account_email}"
}

resource "pingdom_check" "paas_http_healthcheck" {
    type = "http"
    name = "PaaS HTTPS - ${var.env}"
    host = "healthcheck.${var.apps_dns_zone_name}"
    url  = "/"
    encryption = true
    resolution = 1
    uselegacynotifications = true
    sendtoemail = true
    sendnotificationwhendown = 2
    contactids = ["${split(",", var.contact_ids)}"]
}

resource "pingdom_check" "paas_db_healthcheck" {
    type = "http"
    name = "PaaS DB - ${var.env}"
    host = "healthcheck.${var.apps_dns_zone_name}"
    url  = "/db"
    encryption = true
    resolution = 1
    uselegacynotifications = true
    sendtoemail = true
    sendnotificationwhendown = 2
    contactids = ["${split(",", var.contact_ids)}"]
}

Set check URL for Pingdom HTTPS check
Set check URL for Pingdom HTTPS check

So that Terraform doesn't attempt to set the URL on every run:

    Initialized blank state with remote state enabled!
    Remote state configured and pulled.
    pingdom_check.paas_http_healthcheck: Refreshing state... (ID: 2247550)
    pingdom_check.paas_db_healthcheck: Refreshing state... (ID: 2247551)
    pingdom_check.paas_http_healthcheck: Modifying...
      url: "/" => ""
    pingdom_check.paas_http_healthcheck: Modifications complete

    Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

This happens because the Pingdom API has a default by the Terraform provider
doesn't. Longer term I hope to fix the upstream provider as discussed in
russellcardullo/terraform-provider-pingdom#4, but shorter term this change
will make it easier to see whether Terraform is making real changes.

alphagov/paas-cf,alphagov/paas-cf,jimconner/paas-cf,alphagov/paas-cf,jimconner/paas-cf,jimconner/paas-cf,jimconner/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf,jimconner/paas-cf,jimconner/paas-cf,alphagov/paas-cf,alphagov/paas-cf,jimconner/paas-cf