|
| 1 | +--- |
| 2 | +layout: "" |
| 3 | +page_title: dynatrace_api_detection Resource - terraform-provider-dynatrace" |
| 4 | +description: |- |
| 5 | + The resource `dynatrace_api_detection` covers configuration for API detection rules |
| 6 | +--- |
| 7 | + |
| 8 | +# dynatrace_api_detection (Resource) |
| 9 | + |
| 10 | +## Dynatrace Documentation |
| 11 | + |
| 12 | +- Custom API definitions - https://www.dynatrace.com/support/help/platform-modules/applications-and-microservices/services/service-monitoring-settings/customize-api-definitions |
| 13 | + |
| 14 | +- Settings API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings (schemaId: `builtin:apis.detection-rules`) |
| 15 | + |
| 16 | +## Export Example Usage |
| 17 | + |
| 18 | +- `terraform-provider-dynatrace -export dynatrace_api_detection` downloads all existing API detection rule configuration |
| 19 | + |
| 20 | +The full documentation of the export feature is available [here](https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/guides/export-v2). |
| 21 | + |
| 22 | +## Resource Example Usage |
| 23 | + |
| 24 | +```terraform |
| 25 | +resource "dynatrace_api_detection" "#name#" { |
| 26 | + api_color = "#5ead35" |
| 27 | + api_name = "#name#" |
| 28 | + technology = "Go" |
| 29 | + third_party_api = false |
| 30 | + conditions { |
| 31 | + condition { |
| 32 | + base = "PACKAGE" |
| 33 | + matcher = "BEGINS_WITH" |
| 34 | + pattern = "com.terraform" |
| 35 | + } |
| 36 | + } |
| 37 | +} |
| 38 | +``` |
| 39 | + |
| 40 | +<!-- schema generated by tfplugindocs --> |
| 41 | +## Schema |
| 42 | + |
| 43 | +### Required |
| 44 | + |
| 45 | +- `api_color` (String) This color will be used to highlight APIs when viewing code level data, such as distributed traces or method hotspots. |
| 46 | +- `api_name` (String) API name |
| 47 | +- `third_party_api` (Boolean) This API defines a third party library |
| 48 | + |
| 49 | +### Optional |
| 50 | + |
| 51 | +- `conditions` (Block List, Max: 1) List of conditions (see [below for nested schema](#nestedblock--conditions)) |
| 52 | +- `technology` (String) Restrict this rule to a specific technology. |
| 53 | + |
| 54 | +### Read-Only |
| 55 | + |
| 56 | +- `id` (String) The ID of this resource. |
| 57 | + |
| 58 | +<a id="nestedblock--conditions"></a> |
| 59 | +### Nested Schema for `conditions` |
| 60 | + |
| 61 | +Required: |
| 62 | + |
| 63 | +- `condition` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--conditions--condition)) |
| 64 | + |
| 65 | +<a id="nestedblock--conditions--condition"></a> |
| 66 | +### Nested Schema for `conditions.condition` |
| 67 | + |
| 68 | +Required: |
| 69 | + |
| 70 | +- `base` (String) Possible Values: `FILE_NAME`, `FQCN`, `PACKAGE` |
| 71 | +- `matcher` (String) Possible Values: `BEGINS_WITH`, `CONTAINS` |
| 72 | +- `pattern` (String) no documentation available |
| 73 | + |
0 commit comments