Skip to content

mvisonneau/terraform-provider-updown

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

terraform-provider-updown

PkgGoDev Go Report Card test release

Terraform provider for updown.io

Docs

https://registry.terraform.io/providers/mvisonneau/updown/latest/docs

Resources

TYPE NAME DESCRIPTION
data updown_nodes Returns the list of testing nodes ipv4 and ipv6 addresses
resource updown_check Creates a check
resource updown_recipient Creates a recipient
resource updown_webhook Creates a webhook (DEPRECATED)

Example usage

# Import the provider
terraform {
  required_providers {
    updown = {
      source = "mvisonneau/updown"
    }
  }
}

# Configure it
provider "updown" {
  # Can also be set using UPDOWN_API_KEY env variable.
  api_key = "<YOUR_UPDOWN_API_KEY>"
}

# Add a recipient
resource "updown_recipient" "myrecipient" {
  type  = "email"
  value = "foo@bar.baz"
}

# Create a check
resource "updown_check" "mywebsite" {
  alias        = "https://example.com"
  apdex_t      = 1.0
  enabled      = true
  period       = 30
  published    = true
  url          = "https://test.example.com/healthz"
  string_match = "OK"
  mute_until   = "tomorrow"

  recipients = [
    updown_recipient.myrecipient.id,
  ]

  disabled_locations = [
    "mia",
  ]

  custom_headers = {
    "X-GREAT-HEADER" = "yay!"
  }
}

# Add a webhook (DEPRECATED)
resource "updown_webhook" "mywebhook" {
  url = "https://my-nice-webhook.com"
}

# Output ipv4 and ipv6 nodes addresses list
data "updown_nodes" "global" {}

output "updown_nodes_ipv4" {
  value = data.updown_nodes.global.ipv4
}

output "updown_nodes_ipv6" {
  value = data.updown_nodes.global.ipv6
}

Building the provider

~$ export PROVIDER_PATH=${GOPATH}/src/github.com/mvisonneau/terraform-provider-updown
~$ mkdir -p ${PROVIDER_PATH}; cd ${PROVIDER_PATH}
~$ git clone git@github.com:mvisonneau/terraform-provider-updown .
~$ make install

TODO

  • Add tests, need to figure out how to get a mocking endpoint