-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpu.tf
39 lines (36 loc) · 978 Bytes
/
cpu.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
resource "iosxe_mdt_subscription" "cpu_subs" {
for_each = var.cpu_subscriptions
subscription_id = each.key
stream = "yang-push"
encoding = "encode-kvgpb"
source_vrf = "Mgmt-vrf"
update_policy_periodic = var.cpu_periodic
source_address = var.source_address
filter_xpath = each.value.xpath
receivers = [
{
address = var.receiver_ip
port = var.receiver_port
protocol = "grpc-tcp"
}
]
}
variable cpu_periodic {
type = string
default = "100"
description = "Short update interval"
}
#CPU.tf
variable "cpu_subscriptions" {
default = {
100 = {
xpath = "/process-cpu-ios-xe-oper:cpu-usage/cpu-utilization/five-seconds"
},
101 = {
xpath = "/process-cpu-ios-xe-oper:cpu-usage/cpu-utilization/one-minute"
},
102 = {
xpath = "/process-cpu-ios-xe-oper:cpu-usage/cpu-utilization/five-minutes"
}
}
}