Skip to content

Commit

Permalink
fix: make deprecated metric is_active field optional and computed (#285)
Browse files Browse the repository at this point in the history
* update deprecated field to make optional and computed

* run make generate
  • Loading branch information
sloloris authored Feb 6, 2025
1 parent 7dd8f81 commit afcbdc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion docs/data-sources/metric.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@ data "launchdarkly_metric" "example" {
- `key` (String) The unique key that references the metric. A change in this field will force the destruction of the existing resource and the creation of a new one.
- `project_key` (String) The metrics's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

### Optional

- `is_active` (Boolean, Deprecated) Ignored. All metrics are considered active.

### Read-Only

- `analysis_type` (String) The method for analyzing metric events. Available choices are `mean` and `percentile`.
- `description` (String) The description of the metric's purpose.
- `event_key` (String) The event key for your metric (if custom metric)
- `id` (String) The ID of this resource.
- `include_units_without_events` (Boolean) Include units that did not send any events and set their value to 0.
- `is_active` (Boolean, Deprecated) Ignored. All metrics are considered active.
- `is_numeric` (Boolean) Whether a `custom` metric is a numeric metric or not.
- `kind` (String) The metric type. Available choices are `click`, `custom`, and `pageview`.
- `maintainer_id` (String) The LaunchDarkly member ID of the member who will maintain the metric. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently-set maintainer
Expand Down
5 changes: 2 additions & 3 deletions launchdarkly/metrics_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ func baseMetricSchema(isDataSource bool) map[string]*schema.Schema {
TAGS: tagsSchema(tagsSchemaOptions{isDataSource: isDataSource}),
IS_ACTIVE: {
Type: schema.TypeBool,
Optional: !isDataSource,
Computed: isDataSource,
Optional: true,
Computed: true,
Description: "Ignored. All metrics are considered active.",
Default: false,
Deprecated: "No longer in use. This field will be removed in a future major release of the LaunchDarkly provider.",
},
IS_NUMERIC: {
Expand Down

0 comments on commit afcbdc3

Please sign in to comment.