disaster37 / terraform-provider-kibana

Custom provider to handle Kibana API
MIT License
11 stars 21 forks source link

terraform import kibana_user_space doesn't import space name #21

Closed Wing924 closed 2 years ago

Wing924 commented 3 years ago

Assume we have an existing kibana space:

{
  "id": "foo",
  "name": "Foo Space",
  "initials": "FO"
}

and we have a tf file:

resource "kibana_user_space" "foo" {
  uid = "foo"
  name = "Foo Space"
  initials = "FO"
}

When we import it into terraform state, the name is missing. As result, the state becomes:

{
          "index_key": "foo",
          "schema_version": 0,
          "attributes": {
            "color": "",
            "description": "",
            "disabled_features": [],
            "id": "foo",
            "initials": "FO",
            "name": null,
            "uid": "foo"
          },
          "sensitive_attributes": [],
          "private": "..."
        }

When we execute terraform plan after import:

 # kibana_user_space.space.foo will be updated in-place
  ~ resource "kibana_user_space" "foo" {
        id                = "foo"
      + name              = "Foo Space"
        # (3 unchanged attributes hidden)
    }

We expect there should be no changes.

disaster37 commented 2 years ago

Fix on release 8.0.1: https://github.com/disaster37/terraform-provider-kibana/releases/tag/v8.0.1