Resource
dcloud_monitoring_alarm
A metric alarm: fires when a statistic of an instance's, a database node's or a custom series' metric crosses a threshold for evaluation_periods periods; it mails notify_emails and posts to webhook_url.
Example Usage
resource "dcloud_monitoring_alarm" "web_cpu" {
name = "web-cpu-high"
resource_type = "instance"
resource_id = dcloud_instance.web.id
metric = "cpu_percent"
statistic = "avg"
comparator = ">"
threshold = 85
period_seconds = 300
evaluation_periods = 3
notify_emails = ["oncall@acme.example"]
}Schema
Required
comparator(String) How the period’s statistic is compared with threshold: >, >=, < or <= One of:>,>=,<,<=.metric(String) One of cpu_percent, disk_read_iops, disk_write_iops, disk_read_bps, disk_write_bps, network_in_bps, network_out_bps, disk_used_percent, connections, replication_lag_bytes, query_slowdown, docdb_up, tunnel_up, tunnel_in_bps, tunnel_out_bps, bgp_prefixes, api_available, control_plane_ready, nodes_ready, nodes_not_ready, cdn_requests, cdn_cache_hits, cdn_cache_misses, cdn_hit_ratio, cdn_bytes_out, cdn_origin_bytes, waf_blocked, waf_counted, waf_challenged, waf_rate_limited, deploy_duration_seconds, deploys_succeeded, deploys_failed, and one the resource type records (400 otherwise); for custom, the series’ metric namename(String) Unique in the organization (409 when taken): 1–128 characters, no control charactersperiod_seconds(Number) Seconds per evaluated period, a whole number of minutes from 60 to 86400. period × evaluationPeriods may be at most one day. Required over the API; the console’s form starts at 300resource_id(String) The resource’s id as resources lists it, 1–64 letters, digits and dashes; 404 when the organization has no such resource. For custom, the series’ namespace (up to 255 characters; the series need not exist yet)resource_type(String) instance, db_node, vpn_connection, eks_cluster, cdn_distribution, app, or custom: a series the organization publishes itself One of:instance,db_node,vpn_connection,eks_cluster,cdn_distribution,app,custom.threshold(Number) The value the statistic is compared with, in the metric’s unit
Optional
dimensions(Map of String) custom only (400 otherwise): the series’ dimensions; none when omitted. Up to 10 name → value pairs; together with namespace and name they make the seriesenabled(Boolean) Whether a state change notifies anyone; the alarm is evaluated and its state kept either way (default true)evaluation_periods(Number) How many periods in a row are evaluated, 1–100; ALARM when every one breaches (default 1)notify_emails(List of String) Up to 10 addresses, mailed on entering and on leaving ALARM; none by defaultstatistic(String) avg (default), max, min, sum or count (the number of samples) One of:avg,max,min,sum,count.webhook_url(String) An https URL on a public address, up to 2048 characters, POSTed on entering and on leaving ALARM; none by default
Read-Only
id(String) The resource's id.state(String)ok,alarmorinsufficient_data.
Generated from the provider's schema.
Related