Skip to content

[Bug] Error on elastistack_elasticsearch_security_user on TF apply after upgrading to v8 Elastic #101

@RyanHealey1307

Description

@RyanHealey1307

Describe the bug
After upgrading from Elastic v7.17.3 > v8.1.1, when running an apply on a custom module which uses the Elasticstack provider, the resource elastistack_elasticsearch_security_user generates the following error message: Error : Unable to find a user in the cluster..
For context, the user existed when we were on V7.17.3, and it was lost as part of the upgrade. We had not seen this error before.

Remediation
In order to resolve the issue, we had to manually re-create the security user in the Elastic console, then when I subsequently ran a plan and apply, Terraform was able to see the user and the apply was successful.
I would expect Terraform to be able to see the drift in state and real-world, such that the user had been deleted as part of the V8.1.1 upgrade, and subsequently force a replacement. Instead of giving us the error message above.

Debug output

Error : Unable to find a user in the cluster. 
…in resource "elastistack_elasticsearch_security_user" "user":
  1: resource  "elastistack_elasticsearch_security_user" "user" {
Unable to get user: 'user-XXX' from the cluster.

Versions:

  • Terraform Version 1.0.8
  • Provider version 0.3.3
  • Elasticsearch Version 8.1.1

If you require further information, please @ me in the comments. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    ElasticsearchElasticsearch related APIsbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions