You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `metrics_router_routes` input variable allows you to provide a list of routes that will be configured in the IBM Cloud Metrics Routing. Refer [here](https://cloud.ibm.com/docs/metrics-router?topic=metrics-router-about) for more information.
96
+
97
+
- Variable name: `metrics_router_routes`.
98
+
- Type: A list of objects. Each object represents a route.
99
+
- Default value: An empty list (`[]`).
100
+
101
+
### Options for metrics_router_routes
102
+
103
+
-`name` (required): The name of the route.
104
+
-`rules` (required): The routing rules that will be evaluated in their order of the array. You can configure up to 10 rules per route.
105
+
-`action` (optional): The action if the inclusion_filters matches, default is send action. Allowed values are `send` and `drop`.
106
+
-`inclusion_filters` (required): A list of conditions to be satisfied for routing metrics to pre-defined target.'inclusion_filters' is an object with three parameters:
107
+
-`operand` - Part of CRN that can be compared with values. Allowable values are: `location`, `service_name`, `service_instance`, `resource_type`, `resource`.
108
+
109
+
-`operator` - The operation to be performed between operand and the provided values. Allowable values are: `is`, `in`.
110
+
111
+
-`values` - The provided string values of the operand to be compared with.
112
+
-`targets` (required): The target uuid for a pre-defined metrics router target.
113
+
114
+
### Example metrics_router_routes
115
+
116
+
```hcl
117
+
metrics_router_routes = {
118
+
name = "my-route"
119
+
rules {
120
+
action = "send"
121
+
targets {
122
+
id = "c3af557f-fb0e-4476-85c3-0889e7fe7bc4"
123
+
}
124
+
inclusion_filters {
125
+
operand = "location"
126
+
operator = "is"
127
+
values = [ "us-south" ]
128
+
}
129
+
}
130
+
}
131
+
```
132
+
Refer [here](https://cloud.ibm.com/docs/metrics-router?topic=metrics-router-route_rules_definitions&interface=ui) for more information about IBM Cloud Metrics Routing route.
Copy file name to clipboardExpand all lines: solutions/instances/main.tf
+40-7Lines changed: 40 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ locals {
10
10
validate_existing_cloud_monitoring=var.cloud_monitoring_provision&& var.existing_cloud_monitoring_crn!=null?tobool("if cloud_monitoring_provision is set to true, then existing_cloud_monitoring_crn should be null and vice versa") :true
11
11
# tflint-ignore: terraform_unused_declarations
12
12
validate_cos_resource_group=var.existing_cos_instance_crn==null? var.ibmcloud_cos_api_key!=null&& var.cos_resource_group_name==null?tobool("if value for `ibmcloud_cos_api_key` is set, then `cos_resource_group_name` cannot be null") :true:true
13
+
# tflint-ignore: terraform_unused_declarations
14
+
validate_metrics_routing=var.enable_metrics_routing_to_cloud_monitoring? ((var.existing_cloud_monitoring_crn!=null|| var.cloud_monitoring_provision) ?true:tobool("When `enable_metrics_routing_to_cloud_monitoring` is set to true, you must either set `cloud_monitoring_provision` as true or provide the `existing_cloud_monitoring_crn`.")) :true
description="Routes for IBM Cloud Metrics Routing. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-observability-da/blob/main/solutions/instances/DA-types.md#metrics-router-routes-)"
0 commit comments