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

[Bug] Inconsistent state for elasticstack_kibana_synthetics_monitor #965

Open
AnanthRavi opened this issue Dec 18, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working
Milestone

Comments

@AnanthRavi
Copy link

AnanthRavi commented Dec 18, 2024

Describe the bug
I was trying to provision a new monitor using the elasticstack_kibana_synthetics_monitor resource and get the following error

elasticstack_kibana_synthetics_monitor.monitors["test"]: Creating...
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to elasticstack_kibana_synthetics_monitor.monitors["test"], provider
│ "provider[\"registry.terraform.io/elastic/elasticstack\"]" produced an unexpected new value: .space_id: was null, but
│ now cty.StringVal("default").
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to elasticstack_kibana_synthetics_monitor.monitors["test"], provider
│ "provider[\"registry.terraform.io/elastic/elasticstack\"]" produced an unexpected new value: .service_name: was null,
│ but now cty.StringVal("").
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
Releasing state lock. This may take a few moments...

To Reproduce
Sample Code

resource "elasticstack_fleet_agent_policy" "synthetics_policy" {
  name            = "synthetics"
  description     = "Agent policy for kibana synthetics"
  namespace       = "default"
  monitor_logs    = true
  monitor_metrics = true
  skip_destroy    = false
}

resource "elasticstack_kibana_synthetics_private_location" "locations" {
  label           = "internal"
  agent_policy_id = elasticstack_fleet_agent_policy.synthetics_policy.policy_id
  tags            = ["us-east-1"]
}

resource "elasticstack_kibana_synthetics_monitor" "monitors" {
  name      = "network-test-monitor"
  schedule  = 1
  enabled   = false
  tags      = ["us-east-1"]
  private_locations = ["internal"]
  alert = {
    status = {
      enabled = false
    }
    tls = {
      enabled = false
    }
  }
  timeout      = 10
  icmp = {
    host = "1.1.1.1"
  }
}

Expected behavior
The monitor for icmp should be created without any errors

Versions (please complete the following information):

  • OS: Mac Sonoma 14.7
  • Terraform Version 1.5.2
  • Provider version v0.11.12
  • Elasticsearch Version 8.15.1
@AnanthRavi AnanthRavi added the bug Something isn't working label Dec 18, 2024
@biscout42
Copy link
Contributor

Hi @AnanthRavi , as I see the issue is: you didn't provide space_id and service_name, and the assigned value different from empty values.

Could you try as a workaround assign values to these fields? In your case I assume that should be

space_id = "default"
service_name = ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants