Skip to content

datadog_gcp_uc_config: "Provider produced inconsistent result after apply" when billing_account_id contains hyphens #3651

@leacoco

Description

@leacoco

Datadog Terraform Provider Version

v3.91.0

Terraform Version

v1.14.2

What resources or data sources are affected?

datadog_gcp_uc_config

Terraform Configuration Files

resource "datadog_gcp_uc_config" "example" {
  billing_account_id  = "03B59F-8AA142-1DBB1A"  # GCP's standard format
  export_project_name = "my-project"
  export_dataset_name = "billing_detailed"
  bucket_name         = "my-cost-bucket"
  service_account     = "[email protected]"
  export_prefix       = "datadog_cloud_cost_detailed_usage_export"
}

Relevant debug or panic output

No response

Expected Behavior

The resource should be created successfully. The provider should either:

  • Normalize billing_account_id input (replace - with _) before storing in state, or
  • Use a DiffSuppressFunc to treat 03B59F-8AA142-1DBB1A and 03B59F_8AA142_1DBB1A as equivalent

Actual Behavior

│ Error: Provider produced inconsistent result after apply

│ When applying changes to datadog_gcp_uc_config.ccm, provider
│ "provider["registry.terraform.io/datadog/datadog"]" produced an
│ unexpected new value: .billing_account_id: was
│ cty.StringVal("03B59F-8AA142-1DBB1A"), but now
│ cty.StringVal("03B59F_8AA142_1DBB1A").

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions