|
| 1 | +--- |
| 2 | +layout: "" |
| 3 | +page_title: Resource - terraform-provider-dynatrace" |
| 4 | +subcategory: "Service-level Objective" |
| 5 | +description: |- |
| 6 | + The resource `dynatrace_platform_slo` covers configuration for platform service-level objectives |
| 7 | +--- |
| 8 | + |
| 9 | +# dynatrace_platform_slo (Resource) |
| 10 | + |
| 11 | +-> **Dynatrace SaaS only** |
| 12 | + |
| 13 | +-> To utilize this resource, please define the environment variables `DT_CLIENT_ID`, `DT_CLIENT_SECRET`, `DT_ACCOUNT_ID` with an OAuth client including the following permissions: **View SLOs** (`slo:slos:read`) and **Create and edit SLOs** (`slo:slos:write`). |
| 14 | + |
| 15 | +-> This resource is excluded by default in the export utility, please explicitly specify the resource to retrieve existing configuration. |
| 16 | + |
| 17 | +## Dynatrace Documentation |
| 18 | + |
| 19 | +- Service-Level Objectives overview - hhttps://docs.dynatrace.com/docs/deliver/service-level-objectives |
| 20 | + |
| 21 | +- SLO Service Public API - https://########.apps.dynatrace.com/platform/swagger-ui/index.html?urls.primaryName=Service-Level+Objectives |
| 22 | + |
| 23 | +## Resource Example Usage |
| 24 | + |
| 25 | +```terraform |
| 26 | +resource "dynatrace_platform_slo" "#name#" { |
| 27 | + name = "#name#" |
| 28 | + description = "Sample custom SLO" |
| 29 | + tags = [ "ExampleKey:ExampleValue" ] |
| 30 | + criteria { |
| 31 | + criteria_detail { |
| 32 | + target = 96 |
| 33 | + timeframe_from = "now-30d" |
| 34 | + timeframe_to = "now" |
| 35 | + warning = 99 |
| 36 | + } |
| 37 | + } |
| 38 | + custom_sli { |
| 39 | + indicator =<<-EOT |
| 40 | + timeseries { total=sum(dt.service.request.count) ,failures=sum(dt.service.request.failure_count) }, by: { dt.entity.service } |
| 41 | + | fieldsAdd tags=entityAttr(dt.entity.service, "tags") |
| 42 | + | filter in(tags, "criticality:Gold") |
| 43 | + | fieldsAdd entityName = entityName(dt.entity.service) |
| 44 | + | fieldsAdd sli=(((total[]-failures[])/total[])*(100)) |
| 45 | + | fieldsRemove total, failures, tags |
| 46 | + EOT |
| 47 | + } |
| 48 | +} |
| 49 | +``` |
| 50 | + |
| 51 | + |
| 52 | +<!-- schema generated by tfplugindocs --> |
| 53 | +## Schema |
| 54 | + |
| 55 | +### Required |
| 56 | + |
| 57 | +- `criteria` (Block List, Min: 1, Max: 1) Criteria of the SLO (see [below for nested schema](#nestedblock--criteria)) |
| 58 | +- `name` (String) Name of the SLO |
| 59 | + |
| 60 | +### Optional |
| 61 | + |
| 62 | +- `custom_sli` (Block List, Max: 1) Custom SLI of the SLO (see [below for nested schema](#nestedblock--custom_sli)) |
| 63 | +- `description` (String) Description of the SLO |
| 64 | +- `sli_reference` (Block List, Max: 1) SLI reference of the SLO (see [below for nested schema](#nestedblock--sli_reference)) |
| 65 | +- `tags` (Set of String) Tags of the SLO. Example: `Stage:DEV` |
| 66 | + |
| 67 | +### Read-Only |
| 68 | + |
| 69 | +- `id` (String) The ID of this resource. |
| 70 | + |
| 71 | +<a id="nestedblock--criteria"></a> |
| 72 | +### Nested Schema for `criteria` |
| 73 | + |
| 74 | +Required: |
| 75 | + |
| 76 | +- `criteria_detail` (Block List, Min: 1) (see [below for nested schema](#nestedblock--criteria--criteria_detail)) |
| 77 | + |
| 78 | +<a id="nestedblock--criteria--criteria_detail"></a> |
| 79 | +### Nested Schema for `criteria.criteria_detail` |
| 80 | + |
| 81 | +Required: |
| 82 | + |
| 83 | +- `target` (Number) Criteria target, example: `99.8` |
| 84 | +- `timeframe_from` (String) Timeframe from, example: `now-7d` |
| 85 | + |
| 86 | +Optional: |
| 87 | + |
| 88 | +- `timeframe_to` (String) Timeframe to, example: `now` |
| 89 | +- `warning` (Number) Criteria warning, example: `99.9` |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +<a id="nestedblock--custom_sli"></a> |
| 94 | +### Nested Schema for `custom_sli` |
| 95 | + |
| 96 | +Required: |
| 97 | + |
| 98 | +- `indicator` (String) Indicator of the custom SLI. Example: `timeseries sli=avg(dt.host.cpu.idle)` |
| 99 | + |
| 100 | +Optional: |
| 101 | + |
| 102 | +- `filter_segments` (Block List, Max: 1) A filter segment is identified by an ID. Each segment includes a list of variable definitions. (see [below for nested schema](#nestedblock--custom_sli--filter_segments)) |
| 103 | + |
| 104 | +<a id="nestedblock--custom_sli--filter_segments"></a> |
| 105 | +### Nested Schema for `custom_sli.filter_segments` |
| 106 | + |
| 107 | +Required: |
| 108 | + |
| 109 | +- `filter_segment` (Block List, Min: 1) (see [below for nested schema](#nestedblock--custom_sli--filter_segments--filter_segment)) |
| 110 | + |
| 111 | +<a id="nestedblock--custom_sli--filter_segments--filter_segment"></a> |
| 112 | +### Nested Schema for `custom_sli.filter_segments.filter_segment` |
| 113 | + |
| 114 | +Required: |
| 115 | + |
| 116 | +- `id` (String) The ID of the filter segment |
| 117 | + |
| 118 | +Optional: |
| 119 | + |
| 120 | +- `variables` (Block List, Max: 1) Defines a variable with a name and a list of values (see [below for nested schema](#nestedblock--custom_sli--filter_segments--filter_segment--variables)) |
| 121 | + |
| 122 | +<a id="nestedblock--custom_sli--filter_segments--filter_segment--variables"></a> |
| 123 | +### Nested Schema for `custom_sli.filter_segments.filter_segment.variables` |
| 124 | + |
| 125 | +Required: |
| 126 | + |
| 127 | +- `filter_segment_variable` (Block List, Min: 1) (see [below for nested schema](#nestedblock--custom_sli--filter_segments--filter_segment--variables--filter_segment_variable)) |
| 128 | + |
| 129 | +<a id="nestedblock--custom_sli--filter_segments--filter_segment--variables--filter_segment_variable"></a> |
| 130 | +### Nested Schema for `custom_sli.filter_segments.filter_segment.variables.filter_segment_variable` |
| 131 | + |
| 132 | +Required: |
| 133 | + |
| 134 | +- `name` (String) Name of the filter segment variable |
| 135 | +- `values` (Set of String) Values of the filter segment variable |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | +<a id="nestedblock--sli_reference"></a> |
| 143 | +### Nested Schema for `sli_reference` |
| 144 | + |
| 145 | +Required: |
| 146 | + |
| 147 | +- `template_id` (String) Template ID of the SLI reference |
| 148 | +- `variables` (Block List, Min: 1, Max: 1) Variables of the SLI reference (see [below for nested schema](#nestedblock--sli_reference--variables)) |
| 149 | + |
| 150 | +<a id="nestedblock--sli_reference--variables"></a> |
| 151 | +### Nested Schema for `sli_reference.variables` |
| 152 | + |
| 153 | +Required: |
| 154 | + |
| 155 | +- `sli_reference_variable` (Block List, Min: 1) (see [below for nested schema](#nestedblock--sli_reference--variables--sli_reference_variable)) |
| 156 | + |
| 157 | +<a id="nestedblock--sli_reference--variables--sli_reference_variable"></a> |
| 158 | +### Nested Schema for `sli_reference.variables.sli_reference_variable` |
| 159 | + |
| 160 | +Required: |
| 161 | + |
| 162 | +- `name` (String) Name of the SLI reference variable. Example: `hostIds` |
| 163 | +- `value` (String) Value of the SLI reference variable. Example: `HOST-123456789ABCDEFG` |
0 commit comments