Skip to content

[Bug] elasticstack_kibana_synthetics_monitor creation results in an error when applied against a serverless project #883

@acrewdson

Description

@acrewdson

Describe the bug

If you create a fresh serverless project and then attempt to create a synthetics monitor (use this example verbatim), your terraform apply will return an error (even though the monitor creation will have actually succeeded):

│ Error: Failed to create Kibana monitor `foobar1`, namespace default
│
│   with elasticstack_kibana_synthetics_monitor.my_monitor123,
│   on monitors.tf line 1, in resource "elasticstack_kibana_synthetics_monitor" "my_monitor123":
│    1: resource "elasticstack_kibana_synthetics_monitor" "my_monitor123" {
│
│ json: cannot unmarshal string into Go struct field SyntheticsMonitor.locations of type kbapi.MonitorLocationConfig

I think this is because serverless Kibana is currently returning locations in this shape:

 "locations": [
  "us_west"
 ],

Whereas hosted Elastic Cloud (8.15.3) returns the expected shape (and the apply succeeds):

 "locations": [
  {
   "id": "us-west1-a",
   "label": "North America - US West",
   "geo": {
    "lat": 44,
    "lon": -120.5
   },
   "isServiceManaged": true
  }
 ],

I assume this bug may be related to:

I would like to be able to use the Terraform provider to create elasticstack_kibana_synthetics_monitors in serverless projects, but right now this is not possible.

cc @biscout42 @shahzad31

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