# equinix\_fabric\_stream\_alert\_rule(资源)
Fabric V4 API兼容资源允许创建和管理Equinix Fabric流告警规则 \~>注意Equinix Fabric v4流告警规则资源目前处于Beta版。Equinix \_Fabric\_STREAM\_ALERT\_RULE相关的接口可能会在全面上线之前更改。在[https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md提交新问题,以报告您遇到的任何问题](https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md%E6%8F%90%E4%BA%A4%E6%96%B0%E9%97%AE%E9%A2%98%EF%BC%8C%E4%BB%A5%E6%8A%A5%E5%91%8A%E6%82%A8%E9%81%87%E5%88%B0%E7%9A%84%E4%BB%BB%E4%BD%95%E9%97%AE%E9%A2%98)
补充文件:
* 入门指南:
* API:
## 用法示例[](#用法示例 "直接链接至用法示例")
```
resource "equinix_fabric_stream_alert_rule" "new_stream_alert_rule" {
stream_id = ""
name = ""
type = "METRIC_ALERT"
description = ""
enabled = true
metric_selector = {
include = ["equinix.fabric.connection.bandwidth_tx.usage"]
}
detection_method = {
type = "THRESHOLD"
operand = "ABOVE"
window_size = ""
warning_threshold = ""
critical_threshold = ""
}
resource_selector = {
include = ["*/connections/"]
}
}
output "stream_alert_rule_type" {
value = equinix_fabric_stream_alert_rule.new_stream_alert_rule.type
}
output "stream_alert_rule_id" {
value = equinix_fabric_stream_alert_rule.new_stream_alert_rule.uuid
}
output "stream_alert_rule_stream_id" {
value = equinix_fabric_stream_alert_rule.new_stream_alert_rule.stream_id
}
output "stream_alert_rule_state" {
value = equinix_fabric_stream_alert_rule.new_stream_alert_rule.state
}
```
## 模式[](#模式 "直接链接至模式")
### 必填[](#必填 "直接链接至必填")
* `description`(字符串)客户提供的流告警规则描述
* `detection_method`(属性)流告警规则的检测方法([有关嵌套架构](#nestedatt--detection_method),请参阅[下文](#nestedatt--detection_method))
* `metric_selector`(属性)数据流告警规则的指标选择器([有关嵌套架构](#nestedatt--metric_selector),请参阅[下文](#nestedatt--metric_selector))
* `name`(字符串)客户提供的流告警规则名称
* `resource_selector`(属性)数据流告警规则的资源选择器([有关嵌套架构](#nestedatt--resource_selector),请参阅[下文](#nestedatt--resource_selector))
* `stream_id`(string)包含此告警规则的流UUID
* `type`(字符串)流告警规则的类型
### 可选[](#可选 "直接链接至可选")
* `enabled`(布尔值)流告警规则已启用状态
* `timeouts`(属性)([有关嵌套架构](#nestedatt--timeouts),请参阅[下文](#nestedatt--timeouts))
### 只读[](#只读 "直接链接至只读")
* `change_log`(属性)数据流资源上次更改的详细信息([嵌套架构](#nestedatt--change_log)参见[下方](#nestedatt--change_log))
* `href`(字符串) Equinix分配的流告警规则的URI
* `id`(字符串)资源的唯一标识符
* `state`(字符串)值,表示流告警规则的配置状态
* `uuid`(字符串) Equinix为流告警规则分配了唯一标识符
[]()
### 的嵌套架构`detection_method`[](#的嵌套架构detection_method "直接链接至的嵌套架构detection_method")
必需的:
* `type` (字符串)流告警规则检测方法类型
可选:
* `critical_threshold`(字符串)流告警规则指标临界阈值
* `operand`(字符串)流告警规则度量操作数
* `warning_threshold`(字符串)流告警规则指标警告阈值
* `window_size`(字符串)流告警规则指标窗口大小
[]()
### 的嵌套架构`metric_selector`[](#的嵌套架构metric_selector "直接链接至的嵌套架构metric_selector")
必需的:
* `include` (字符串列表)要包含的指标列表
[]()
### 的嵌套架构`resource_selector`[](#的嵌套架构resource_selector "直接链接至的嵌套架构resource_selector")
必需的:
* `include` (字符串列表)要包含的指标列表
[]()
### 的嵌套架构`timeouts`[](#的嵌套架构timeouts "直接链接至的嵌套架构timeouts")
可选:
* `create` (string)可[解析为持续时间的](https://pkg.go.dev/time#ParseDuration)字符串,由数字和单位后缀组成,例如“30s”或“2h45m”。有效时间单位为“s”(秒),“m”(分钟),“h”(小时)。
* `delete`(string)可[解析为持续时间的](https://pkg.go.dev/time#ParseDuration)字符串,由数字和单位后缀组成,例如“30s”或“2h45m”。有效时间单位为“s”(秒),“m”(分钟),“h”(小时)。仅当更改保存到销毁操作发生之前的状态时,删除操作的超时才适用。
* `read`(string)可[解析为持续时间的](https://pkg.go.dev/time#ParseDuration)字符串,由数字和单位后缀组成,例如“30s”或“2h45m”。有效时间单位为“s”(秒),“m”(分钟),“h”(小时)。启用刷新后,读取操作将在任何刷新或计划操作期间进行。
* `update`(string)可[解析为持续时间的](https://pkg.go.dev/time#ParseDuration)字符串,由数字和单位后缀组成,例如“30s”或“2h45m”。有效时间单位为“s”(秒),“m”(分钟),“h”(小时)。
[]()
### 的嵌套架构`change_log`[](#的嵌套架构change_log "直接链接至的嵌套架构change_log")
只读:
* `created_by` (字符串)流资源创建者的用户名
* `created_by_email`(字符串)流资源创建者的电子邮件
* `created_by_full_name`(字符串)流资源创建者的法定名称
* `created_date_time`(字符串)流资源的创建时间
* `deleted_by`(字符串)数据流资源删除器的用户名
* `deleted_by_email`(string)数据流资源删除器的电子邮件
* `deleted_by_full_name`(string)数据流资源删除器的法定名称
* `deleted_date_time`(字符串)数据流资源的删除时间
* `updated_by`(字符串)数据流资源上次更新器的用户名
* `updated_by_email`(字符串)数据流资源最后更新器的电子邮件
* `updated_by_full_name`(字符串)数据流资源最后更新器的法定名称
* `updated_date_time`(string)流资源的上次更新时间