Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] elasticstack_elasticsearch_snapshot_repository gcs.base_path is ignored #925

Open
BapRx opened this issue Nov 22, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@BapRx
Copy link

BapRx commented Nov 22, 2024

Describe the bug

I want to configure the Base path of a GCS snapshot repository but the Terraform provider ignores the base_path setting. If I manually add it on the console, the plan doesn't even show the diff.

Image

To Reproduce
Steps to reproduce the behavior:

  1. TF configuration used
resource "elasticstack_elasticsearch_snapshot_repository" "gcs" {
  name = "elasticsearch-backup"

  gcs {
    bucket    = "elasticsearch-backup"
    base_path = "elasticsearch-data"
  }
}
  1. TF operations to execute to get the error : terraform plan

Expected behavior
The base path setting should be updated.

Versions (please complete the following information):

  • OS: MacOS
  • Terraform Version 1.9.8
  • Provider version v0.11.11
  • Elasticsearch Version 7.17.0
@BapRx BapRx added the bug Something isn't working label Nov 22, 2024
@BapRx
Copy link
Author

BapRx commented Nov 22, 2024

I just realized the behavior is not exactly as described, here's what is happening :

Base path configured on Kibana base_path set in Terraform Kibana Base Path == Terraform base_path? Terraform plan shows diff? Expected behavior?
Yes No No (Terraform should set it to null or empty string) No No
Yes Yes Yes No Yes
Yes Yes No Yes Yes
No No Yes No Yes
No Yes No Yes Yes

If it's the normal behavior (base_path not set -> don't edit it on Kibana even if it is set), feel free to close the issues.

@tobio
Copy link
Member

tobio commented Nov 23, 2024

Thanks for the bug report, the table is especially helpful, 💯!

If it's the normal behavior (base_path not set -> don't edit it on Kibana even if it is set), feel free to close the issues.

This is correct. The provider won't show a diff for unconfigured attributes in this case (any most optional attributes across the provider). Another test case worth checking prior to closing this is the behaviour when base_path = null in Terraform. This should reset the base path to the ES default but I wouldn't be surprised if that's not the current behaviour though. I'll leave this open until we get a chance to test that case out.

@BapRx
Copy link
Author

BapRx commented Nov 25, 2024

Thanks for clarifying 🙂 I just tested with null and it ignores the change as well, the plan shows No changes although there is a base path configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants