|
| 1 | +--- |
| 2 | +layout: "wallarm" |
| 3 | +page_title: "Wallarm: wallarm_api_discovery_config" |
| 4 | +subcategory: "API Discovery" |
| 5 | +description: |- |
| 6 | + Manages the per-tenant API Discovery configuration. |
| 7 | +--- |
| 8 | + |
| 9 | +# wallarm_api_discovery_config |
| 10 | + |
| 11 | +Manages the [API Discovery][1] configuration for a Wallarm tenant — the settings page in the console under **Settings → API Discovery**: the master toggle, which protocols to analyse, request-content filtering, endpoint-stability thresholds, parameter-type and PII detection thresholds, and the per-application include/exclude list. |
| 12 | + |
| 13 | +API Discovery configuration is a **singleton per `client_id`** — the record always exists on the server. Declaring two `wallarm_api_discovery_config` resources for the same client will conflict (each apply overwrites the previous). |
| 14 | + |
| 15 | +## Example Usage |
| 16 | + |
| 17 | +```hcl |
| 18 | +resource "wallarm_api_discovery_config" "this" { |
| 19 | + enabled = true |
| 20 | + apply_extended_filter = true |
| 21 | + type_detection_threshold = 0.5 |
| 22 | + pii_detection_threshold = 0.1 |
| 23 | + disabled_apps = [] |
| 24 | +
|
| 25 | + protocols { |
| 26 | + rest = true |
| 27 | + graphql = true |
| 28 | + soap = true |
| 29 | + grpc = true |
| 30 | + mcp = true |
| 31 | + } |
| 32 | +
|
| 33 | + endpoint_stability { |
| 34 | + min_count = 2 |
| 35 | + min_time = 300 |
| 36 | + } |
| 37 | +} |
| 38 | +``` |
| 39 | + |
| 40 | +Multi-tenant: |
| 41 | + |
| 42 | +```hcl |
| 43 | +resource "wallarm_api_discovery_config" "tenant_a" { |
| 44 | + client_id = 22510 |
| 45 | + enabled = true |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +## Argument Reference |
| 50 | + |
| 51 | +### General |
| 52 | + |
| 53 | +* `client_id` - (Optional, ForceNew) Client ID. Defaults to the provider's client ID. |
| 54 | +* `enabled` - (Optional, Default: `true`) Master toggle for API Discovery. |
| 55 | + |
| 56 | +### Protocols |
| 57 | + |
| 58 | +A `protocols` block configures which protocols API Discovery analyses. The block is `Optional` — omitting it enables all five. |
| 59 | + |
| 60 | +* `rest` - (Optional, Default: `true`) |
| 61 | +* `graphql` - (Optional, Default: `true`) |
| 62 | +* `soap` - (Optional, Default: `true`) |
| 63 | +* `grpc` - (Optional, Default: `true`) |
| 64 | +* `mcp` - (Optional, Default: `true`) |
| 65 | + |
| 66 | +### Filtering |
| 67 | + |
| 68 | +* `apply_extended_filter` - (Optional, Default: `true`) Filter endpoints by response content type. |
| 69 | +* `disabled_apps` - (Optional) List of pool/application IDs to exclude from API Discovery. Default: empty list. |
| 70 | + |
| 71 | +### Detection thresholds |
| 72 | + |
| 73 | +Fractions in the `[0.0, 1.0]` range (the console displays them as percentages). |
| 74 | + |
| 75 | +* `type_detection_threshold` - (Optional, Default: `0.5`) Fraction of requests used to determine parameter types. |
| 76 | +* `pii_detection_threshold` - (Optional, Default: `0.1`) Fraction of requests used to detect sensitive data. |
| 77 | + |
| 78 | +### Endpoint stability |
| 79 | + |
| 80 | +An `endpoint_stability` block defines when a newly observed endpoint is promoted to the discovered inventory. |
| 81 | + |
| 82 | +* `min_count` - (Optional, Default: `2`, Range: `1–100`) Minimum number of requests. |
| 83 | +* `min_time` - (Optional, Default: `300`, Range: `1–900`) Minimum time window in seconds. |
| 84 | + |
| 85 | +## Attributes Reference |
| 86 | + |
| 87 | +In addition to the arguments above, the following read-only attributes are populated from the API on Read: |
| 88 | + |
| 89 | +* `call_points_storage_limit` - Storage limit for call points. |
| 90 | +* `group_soap` - Whether SOAP endpoints are grouped under a parent definition. |
| 91 | +* `allowed_content_types_patterns` - Content-type patterns considered for discovery. |
| 92 | +* `sensitive_samples` - Sample-masking configuration (block): `enabled`, `min_masked`, `max_masked`, `mask_symbols`. |
| 93 | +* `server_variability` - Server-variability heuristics (block): `enabled`, `by_date_enabled`, `by_local_code_enabled`, `by_email_enabled`, `by_alphanumeric_id_enabled`; nested `by_custom_paths` sub-block with `enabled` and `paths`. |
| 94 | +* `extensions_whitelist` - File-extension allowlist (block): `enabled`, `extensions`. |
| 95 | + |
| 96 | +These mirror the API's full response shape but cannot be set via Terraform — they're surfaced for drift visibility. |
| 97 | + |
| 98 | +## Import |
| 99 | + |
| 100 | +```bash |
| 101 | +terraform import wallarm_api_discovery_config.this 22510/apid_config |
| 102 | +``` |
| 103 | + |
| 104 | +The import ID format is `{client_id}/apid_config`. The suffix is constant; the `client_id` prefix identifies the tenant. |
| 105 | + |
| 106 | +Deleting the resource from Terraform state is a noop — the singleton record persists on the server. To restore defaults, set the schema's Optional+Default values explicitly in HCL and `terraform apply`. |
| 107 | + |
| 108 | +[1]: https://docs.wallarm.com/api-discovery/overview/ |
0 commit comments