Skip to content

[Bug] v0.11.15 new .global_data_tags produces error during apply #1112

@BenB196

Description

@BenB196

Describe the bug

Observe that after upgrading to 0.11.15 the following error happens;

╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to elasticstack_fleet_agent_policy.switch_snmp,
│ provider "provider[\"registry.terraform.io/elastic/elasticstack\"].fleet"
│ produced an unexpected new value: .global_data_tags: was
│ cty.MapValEmpty(cty.Object(map[string]cty.Type{"number_value":cty.Number,
│ "string_value":cty.String})), but now null.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵

To Reproduce
Steps to reproduce the behavior:

  1. Example config
resource "elasticstack_fleet_agent_policy" "router_snmp" {
  name            = "Production Router SNMP"
  namespace       = local.default_namespace
  description     = "Policy for Prometheus SNMP monitoring for Routers"
  sys_monitoring  = false
  monitor_logs    = true
  monitor_metrics = true

  provider = elasticstack.fleet
}
  1. TF operation terraform apply
  2. See the error in the output '...'
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to elasticstack_fleet_agent_policy.switch_snmp,
│ provider "provider[\"registry.terraform.io/elastic/elasticstack\"].fleet"
│ produced an unexpected new value: .global_data_tags: was
│ cty.MapValEmpty(cty.Object(map[string]cty.Type{"number_value":cty.Number,
│ "string_value":cty.String})), but now null.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵

Note that the plan output looks like:

  # elasticstack_fleet_agent_policy.router_snmp will be updated in-place
  ~ resource "elasticstack_fleet_agent_policy" "router_snmp" {
      + global_data_tags = {}
        id               = "bcdd0e4d-867c-4aeb-b307-e3769e4885a3"
        name             = "Production Router SNMP"
        # (6 unchanged attributes hidden)
    }

Expected behavior

No error

Versions (please complete the following information):

  • OS: Linux
  • Terraform Version 1.11.2
  • Provider version 0.11.15
  • Elasticsearch Version 8.17.1

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions