The Statuspage provider is used to interact with the resources supported by Statuspage.io. Authentication currently works by setting the environment variable STATUSPAGE_TOKEN or by configuring the provider:
provider "statuspage" {
token = "YOURTOKEN"
}
You can download the latest build from Gitlab
Components are the individual pieces of infrastructure that are listed on your status page.
resource "statuspage_component" "my_component" {
page_id = "pageid"
name = "My Website"
description = "Status of my website"
status = "operational"
}
The following arguments are supported:
- page_id - (Required) the id of the page this component belongs to
- name - (Required) Name of the component
- description - Description of the component
- status - status of the component - must be one of "operational", "under_maintenance", "degraded_performance", "partial_outage", "major_outage" or ""
- only_show_if_degraded (bool) - Should this component be shown component only if in degraded state
- showcase (bool) - Should this component be showcased
The following attributes are exported:
- automation_email - Email address to send automation events to
Component groups provide a way to organize components. When a group is deleted, its child components will be orphaned. Note: A group cannot be empty, so if all the child components are deleted, the group will be deleted automatically. Another implication of this is that components must be created before their groups, when a group is created it will require a list of component IDs.
resource "statuspage_component_group" "my_group" {
page_id = "pageid"
name = "terraform"
description = "Created by terraform"
components = ["${statuspage_component.my_component.id}"]
}
The following arguments are supported:
- page_id - (Required) the id of the page this component belongs to
- components - (Required) List of component IDs
- name - (Required) name of the component group
- description - description of the component group
System metrics are a great way to build trust and transparency around your organization, and ensure that your page is doing work for you each and every day.
resource "statuspage_metric" "website_metrics" {
page_id = "pageid"
metrics_provider_id = "${statuspage_metrics_provider.statuspage_pingdom.id}"
name = "My Website"
metric_identifier = "pingdom_check_id"
}
The following arguments are supported:
- page_id - (Required) the id of the page this component belongs to
- name - Name of metric
- metric_identifier - The identifier used to look up the metric data from the provider
- transform - The transform to apply to metric before pulling into Statuspage. One of: "average", "count", "max", "min", or "sum"
- suffix - Suffix to describe the units on the graph
- y_axis_min - The lower bound of the y axis
- y_axis_max - The upper bound of the y axis
- y_axis_hidden - Should the values on the y axis be hidden on render
- display - Should the metric be displayed
- decimal_places - How many decimal places to render on the graph
- tooltip_description - A description for the tooltip
resource "statuspage_metrics_provider" "statuspage_pingdom" {
page_id = "pageid"
email = "[email protected]"
password = "pingdom_password"
application_key = "pingdomAppKey"
type = "Pingdom"
}
The following arguments are supported:
- page_id - (Required) the id of the page this component belongs to
- type - (Required) One of "Pingdom", "NewRelic", "Librato", "Datadog", or "Self"
- email - Required by the Librato and Pingdom type metrics providers.
- password - Required by the Pingdom-type metrics provider.
- api_key - Required by the Datadog and NewRelic type metrics providers.
- api_token - Required by the Librato type metrics provider.
- application_key - Required by the Pingdom and Datadog type metrics providers.
Clone repository to: `$GOPATH/src/github.com/yannh/terraform-provider-statuspage
$ mkdir -p $GOPATH/src/github.com/yannh; cd $GOPATH/src/github.com/yannh
$ git clone https://github.com/yannh/terraform-provider-statuspage.git
Enter the provider directory and build the provider
$ cd $GOPATH/src/github.com/yannh/terraform-provider-statuspage
$ make build
If you wish to work on the provider, you'll first need Go installed on your machine (version 1.11+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin
to your $PATH
.
To compile the provider, run make build
. This will build the provider and put the provider binary in the $GOPATH/bin
directory.
$ make build
...
$ $GOPATH/bin/terraform-provider-statuspage
...
In order to test the provider, set the following variables:
$ export STATUSPAGE_TOKEN=www
$ export STATUSPAGE_PAGE=xxx
$ export DATADOG_API_KEY=yyy
$ export DATADOG_APPLICATION_KEY=zzz
, and then run make test acc
.
$ make test acc