Provides a Fastly Alert. Alerts send notifications to custom integrations (e.g., Slack channels, PagerDuty, Microsoft Teams and New Relic) when an observed metric either exceeds or falls below a threshold.
resource "fastly_service_vcl" "example" {
name = "my_vcl_service"
# ...
}
resource "fastly_integration" "example" {
name = "my_integration"
# ...
}
resource "fastly_alert" "example" {
name = "my_vcl_service errors"
service_id = fastly_service_vcl.example.id
source = "stats"
metric = "status_5xx"
evaluation_strategy {
type = "above_threshold"
period = "5m"
threshold = 10
}
integration_ids = [fastly_integration.example.id]
}
Fastly Alerts can be imported using their ID, e.g.
$ terraform import fastly_alert.example xxxxxxxxxxxxxxxxxxxx
evaluation_strategy
(Block List, Min: 1, Max: 1) Criteria on how to alert. (see below for nested schema)metric
(String) The metric name to alert on for a specific source: domains, origins, or stats.name
(String) The name of the alert.service_id
(String) The service which the alert monitors.source
(String) The source where the metric comes from. One of: domains
, origins
, stats
.description
(String) Additional text that is included in the alert notification.dimensions
(Block List, Max: 1) More filters depending on the source type. (see below for nested schema)integration_ids
(Set of String) List of integrations used to notify when alert fires.id
(String) The ID of this resource.evaluation_strategy
Required:
period
(String) The length of time to evaluate whether the conditions have been met. The data is polled every minute. One of: 2m
, 3m
, 5m
, 15m
, 30m
.threshold
(Number) Threshold used to alert.type
(String) Type of strategy to use to evaluate. One of: above_threshold
, all_above_threshold
, below_threshold
, percent_absolute
, percent_decrease
, percent_increase
.Optional:
ignore_below
(Number) Threshold for the denominator value used in evaluations that calculate a rate or ratio. Usually used to filter out noise.dimensions
Optional:
domains
(Set of String) Names of a subset of domains that the alert monitors.origins
(Set of String) Addresses of a subset of backends that the alert monitors.