--- layout: "" page_title: "dynatrace_slo_v2 Resource - terraform-provider-dynatrace" subcategory: "Service-level Objective" description: |- The resource `dynatrace_slo_v2` covers configuration for service-level objectives --- # dynatrace_slo_v2 (Resource) -> This resource requires the API token scopes **Read SLO** (`slo.read`), **Write SLO** (`slo.write`), **Read settings** (`settings.read`) and **Write settings** (`settings.write`) ## Dynatrace Documentation - Service-level objectives - https://www.dynatrace.com/support/help/how-to-use-dynatrace/cloud-automation/service-level-objectives - Settings API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings (schemaId: `builtin:monitoring.slo`) ## Export Example Usage - `terraform-provider-dynatrace -export dynatrace_slo_v2` downloads all existing service-level objectives configuration The full documentation of the export feature is available [here](https://dt-url.net/h203qmc). ## Resource Example Usage ```terraform resource "dynatrace_slo_v2" "#name#" { name = "#name#" enabled = true custom_description = "Terraform Test" evaluation_type = "AGGREGATE" evaluation_window = "-1w" filter = "type(SERVICE),serviceType(WEB_SERVICE,WEB_REQUEST_SERVICE)" metric_expression = "100*(builtin:service.requestCount.server:splitBy())/(builtin:service.requestCount.server:splitBy())" metric_name = "terraform_test#name#" target_success = 95 target_warning = 98 error_budget_burn_rate { burn_rate_visualization_enabled = false } } ``` ## Schema ### Required - `enabled` (Boolean) This setting is enabled (`true`) or disabled (`false`) - `error_budget_burn_rate` (Block List, Min: 1, Max: 1) ### Error budget burn rate (see [below for nested schema](#nestedblock--error_budget_burn_rate)) - `evaluation_type` (String) Possible Values: `AGGREGATE` - `evaluation_window` (String) Define the timeframe during which the SLO is to be evaluated. For the timeframe you can enter expressions like -1h (last hour), -1w (last week) or complex expressions like -2d to now (last two days), -1d/d to now/d (beginning of yesterday to beginning of today). - `filter` (String) Set a filter parameter (entitySelector) on any GET call to evaluate this SLO against specific services only (for example, type("SERVICE")). For details, see the [Entity Selector documentation](https://dt-url.net/entityselector). - `metric_expression` (String) For details, see the [Metrics page](/ui/metrics "Metrics page"). - `name` (String) SLO name - `target_success` (Number) Set the target value of the SLO. A percentage below this value indicates a failure. - `target_warning` (Number) Set the warning value of the SLO. At the warning state the SLO is fulfilled. However, it is getting close to a failure. ### Optional - `custom_description` (String) The description of the SLO - `legacy_id` (String) The ID of this setting when referred to by the Config REST API V1 - `metric_name` (String) Metric name ### Read-Only - `id` (String) The ID of this resource. ### Nested Schema for `error_budget_burn_rate` Required: - `burn_rate_visualization_enabled` (Boolean) Burn rate visualization enabled Optional: - `fast_burn_threshold` (Number) The threshold defines when a burn rate is marked as fast-burning (high-emergency). Burn rates lower than this threshold (and greater than 1) are highlighted as slow-burn (low-emergency).