Skip to content

[Bug] 0.11.10 forces api key replacement due to whitespaces #873

Closed
@Davasny

Description

@Davasny

Describe the bug
After upgrading provider from 0.11.8 to 0.11.10 it want to replace api key due to whitespace changes. Api key role_descriptors are not changed

To Reproduce

  1. Create api key with 0.11.8
  2. Upgrade provider to 0.11.10
  3. Run plan
  # elasticstack_elasticsearch_security_api_key.telegraf must be replaced
-/+ resource "elasticstack_elasticsearch_security_api_key" "telegraf" {
      ~ api_key              = (sensitive value)
      ~ encoded              = (sensitive value)
      ~ expiration_timestamp = 0 -> (known after apply)
      ~ id                   = "25opFie5T1qs3JS9dz9YFA/daCobZIBlhlmOGXYaM3k" -> (known after apply)
      ~ key_id               = "daCobZIBlhlmOGXYaM3k" -> (known after apply)
      ~ metadata             = jsonencode({}) -> (known after apply)
        name                 = "telegraf"
      ~ role_descriptors     = jsonencode( # whitespace changes
            {
                telegraf = {
                    cluster = [
                        "monitor",
                        "cluster:admin/snapshot/status",
                        "cluster:admin/repository/get",
                        "manage_slm",
                    ]
                    indices = [
                        {
                            allow_restricted_indices = true
                            names                    = [
                                "*",
                            ]
                            privileges               = [
                                "monitor",
                                "view_index_metadata",
                            ]
                        },
                    ]
                }
            }
        )
        # (1 unchanged attribute hidden)
    }

Plan: 1 to add, 0 to change, 1 to destroy.

Expected behavior
Whitespaces shouldn't force api key replacement

Debug output
N/A

Screenshots
N/A

Versions (please complete the following information):

  • OS: macos 15
  • terraform 1.8.0
  • provider registry.terraform.io/elastic/elasticstack v0.11.10
  • elasticsearch 8.14.3 on elastic.co

Additional context
N/A

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