Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider produced inconsistent final plan - Replacing - with _ in names of datadog_metric_metadata.metric_description #2432

Closed
jonathanrainer opened this issue Jun 11, 2024 · 1 comment · Fixed by #2433
Labels

Comments

@jonathanrainer
Copy link

jonathanrainer commented Jun 11, 2024

Datadog Terraform Provider Version

v3.39.0

Terraform Version

v1.7

What resources or data sources are affected?

datadog_metric_metadata.metric_description

Terraform Configuration Files

locals {
  functions = {
    ...
    "install-plugin" = {
      url_pattern = "..."
    },
    ...
  }
}

module "http_metrics_per_function" {
  source   = "./modules/custom_metric"
  for_each = local.functions
  ...
  name            = "orbiter.${each.key}.http.request"
  ...
}

resource "datadog_logs_metric" "this" {
  name = var.name
  ...
}

resource "datadog_metric_metadata" "metric_description" {
  metric          = datadog_logs_metric.this.name
  ...
}

Relevant debug or panic output

Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for
│ module.http_metrics_per_function["install-plugin"].datadog_metric_metadata.metric_description
│ to include new values learned so far during apply, provider
│ "registry.terraform.io/datadog/datadog" produced an invalid new value for
│ .metric: was cty.StringVal("orbiter.install-plugin.http.request"), but now
│ cty.StringVal("orbiter.install_plugin.http.request").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Expected Behavior

The Terraform should have applied correctly with the name install-plugin rather than install_plugin

Actual Behavior

The Terraform errored with the error given above.

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@nkzou
Copy link
Contributor

nkzou commented Jun 11, 2024

Hi, dashes are invalid in metric names per https://docs.datadoghq.com/metrics/custom_metrics/#naming-custom-metrics
I'll keep this issue open to track adding provider-side validation for this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants