Skip to content

[Bug] connector_id is not used when creating an alerting connector #1088

Open
@wandergeek

Description

@wandergeek

Describe the bug
When creating a elasticstack_kibana_action_connector with a configured connector_id, the connector is created with a standard machine generated UUID rather than using the provided one.

To Reproduce
Steps to reproduce the behavior:

  1. TF configuration used '...'

  2. TF operations to execute to get the error '...' [e.g terraform plan,terraform apply, terraform destroy]

  3. See the error in the output '...'

  4. TF configuration used

resource "elasticstack_kibana_action_connector" "my-new-connector3" {
  name              = "human-uuid"
  connector_id      = "lugoz-safes-rusin-bubov-fytex-cydeb"
  connector_type_id = ".slack_api"
  secrets = jsonencode({
    token = "dummy value"
  })
}
  1. terraform apply

  2. In devtools for target cluster: GET kbn:/api/actions/connectors

  {
    "id": "aa1b7fc0-0f4e-11f0-91a0-5df3db21f544",
    "name": "human-uuid",
    "config": {},
    "connector_type_id": ".slack_api",
    "is_preconfigured": false,
    "is_deprecated": false,
    "referenced_by_count": 0,
    "is_missing_secrets": false,
    "is_system_action": false
  },

Note that the ID is not as configured.

Expected behavior
The connector_id should be configured as the ID of the resource on the target cluster.

Debug output
An interesting debugging message appears in a TRACE:

2025-04-01T23:11:39.118Z [WARN]  Provider "provider[\"registry.terraform.io/elastic/elasticstack\"].cluster-mgmt-a" produced an unexpected new value for module.connectors__cluster-mgmt-a.elasticstack_kibana_action_connector.my-new-connector3, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .connector_id: was cty.StringVal("lugoz-safes-rusin-bubov-fytex-cydeb"), but now cty.StringVal("aa1b7fc0-0f4e-11f0-91a0-5df3db21f544")
2025-04-01T23:11:39.118Z [TRACE] terraform.contextPlugins: Schema for provider "registry.terraform.io/elastic/elasticstack" is in the global cache
2025-04-01T23:11:39.118Z [WARN]  Provider "provider[\"registry.terraform.io/elastic/elasticstack\"].cluster-mgmt-b" produced an unexpected new value for module.connectors__cluster-mgmt-b.elasticstack_kibana_action_connector.my-new-connector3, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .connector_id: was cty.StringVal("lugoz-safes-rusin-bubov-fytex-cydeb"), but now cty.StringVal("aa1bcde0-0f4e-11f0-8489-7ba348415789")

Versions (please complete the following information):

  • OS: MacOS
  • Terraform Version : v1.10.4
  • Provider version terraform-provider-elasticstack_v0.11.14
  • Elasticsearch Version 8.11.1

More info

This definitely works in the API

❯ curl -X POST -u elastic:changeme http://localhost:5601/api/actions/connector/facecafe-dead-4bad-babe-8badf00dbeef  -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
    "name": "o11y-alertbot",
    "connector_type_id": ".slack",
    "secrets": {
      "webhookUrl": "https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz"
    }
}'
{"id":"facecafe-dead-4bad-babe-8badf00dbeef","name":"o11y-alertbot","config":{},"connector_type_id":".slack","is_preconfigured":false,"is_deprecated":false,"is_missing_secrets":false,"is_system_action":false}%

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions