Home

Awesome

terraform-provider-pingdom

I no longer use Pingdom and no longer maintain this project.

This project is a terraform provider for pingdom.

This currently only supports working with basic HTTP and ping checks.

This supports Pingdom API v3.1: API reference docs

Requirements

Usage

Use provider

terraform {
  required_providers {
    pingdom = {
      source = "russellcardullo/pingdom"
      version = "1.1.3"
    }
  }
}

variable "pingdom_api_token" {}

provider "pingdom" {
    api_token = "${var.pingdom_api_token}"
}

Basic Check

resource "pingdom_check" "example" {
    type = "http"
    name = "my http check"
    host = "example.com"
    resolution = 5
}

resource "pingdom_check" "example_with_alert" {
    type = "http"
    name = "my http check"
    host = "example.com"
    resolution = 5
    sendnotificationwhendown = 2 # alert after 5 mins, with resolution 5*(2-1)
    integrationids = [
      12345678,
      23456789
    ]
    userids = [
      24680,
      13579
    ]
}

resource "pingdom_check" "ping_example" {
    type = "ping"
    name = "my ping check"
    host = "example.com"
    resolution = 1
    userids = [
      24680
    ]
}

Apply with:

 terraform apply \
    -var 'pingdom_api_token=YOUR_API_TOKEN'

Using attributes from other resources

variable "heroku_email" {}
variable "heroku_api_key" {}

variable "pingdom_api_token" {}

provider "heroku" {
    email = var.heroku_email
    api_key = var.heroku_api_key
}

provider "pingdom" {
    api_token = var.pingdom_api_token
}

resource "heroku_app" "example" {
    name = "my-app"
    region = "us"
}

resource "pingdom_check" "example" {
    name = "my check"
    host = heroku_app.example.heroku_hostname
    resolution = 5
}

Teams

resource "pingdom_team" "test" {
  name = "The Test team"
  member_ids = [
    pingdom_contact.first_contact.id,
  ]
}

Contacts

Note that all contacts must have both a high and low severity notification


resource "pingdom_contact" "first_contact" {
  name = "johndoe"

  sms_notification {
    number   = "5555555555"
    severity = "HIGH"
  }

  sms_notification {
    number       = "3333333333"
    country_code = "91"
    severity     = "LOW"
    provider     = "esendex"
  }

  email_notification {
    address  = "test@test.com"
    severity = "LOW"
  }
}

resource "pingdom_contact" "second_contact" {
  name   = "janedoe"
  paused = true

  email_notification {
    address  = "test@test.com"
    severity = "LOW"
  }

  email_notification {
    address  = "test@test.com"
    severity = "HIGH"
  }
}

Resources

Pingdom Check

Common Attributes

The following common attributes for all check types can be set:

Note that when using integrationids, the sendnotificationwhendown value will be ignored when sending webhook notifications. You may need to contact Pingdom support for more details. See #52.

HTTP specific attributes

For the HTTP checks, you can set these attributes:

TCP specific attributes

For the TCP checks, you can set these attributes:

The following attributes are exported:

Pingdom Team

Pingdom Contact

Develop The Provider

Dependencies for building from source

If you need to build from source, you should have a working Go environment setup. If not check out the Go getting started guide.

This project uses Go Modules for dependency management. To fetch all dependencies run go get inside this repository.

Build

make build

The binary will then be available at _build/terraform-provider-pingdom_VERSION.

Install

make install

This will place the binary under $HOME/.terraform.d/plugins/OS_ARCH/terraform-provider-pingdom_VERSION. After installing you will need to run terraform init in any project using the plugin.