Open sharathganga opened 10 months ago
Hi @rblcoder @premkirank @SkollRyu @afrodidact @tranngocsongtruc could you take a look and add your thoughts?
cc: @prudhvigodithi
Thanks.
I see the same behaviour provider version 2.0.0, opensearch version 2.2.1
@rblcoder can you please take a look and add your thoughts ?
rollover_alias is a computed attribute. https://discuss.hashicorp.com/t/computed-attributes-and-plan-modifiers/45830/14#:~:text=The%20framework%20will%20automatically%20mark,prevent%20Terraform%20data%20consistency%20errors. says The framework will automatically mark Computed attributes with null configuration as unknown (known after apply) during the plan, which is intentional to prevent Terraform data consistency errors.
Also please try setting number_of_shards and number_of_replicas as follows that is as separate key/value pairs instead of within settings, documentation https://registry.terraform.io/providers/jamesanto/opensearch/latest/docs/resources/index -
resource "opensearch_index" "index" {
name = "test-logs-000001"
number_of_shards = 3
number_of_replicas = 1
@rblcoder number_of_shards
and number_of_replicas
on the index are being managed from opensearch_index_template
resource
What is the bug?
When I attempt to import the opensearch_index resource with aliases configured, it doesn't get imported into the state.
How can one reproduce the bug?
Provided an index that was created with aliases
then run the terraform import command
terraform import opensearch_index.index[\"ci-metrics\"] ci-metrics-000001
but this is how the resource looks in the state
Finally when I run a terraform plan, it tells me that the index will replaced to add aliases
What is the expected behavior?
Terraform should import the aliases field and/or any other missing fields
What is your host/environment?
$ uname -a Linux PBL244 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ terraform version Terraform v1.5.3 on linux_amd64
Your version of Terraform is out of date! The latest version is 1.6.2. You can update by downloading from https://www.terraform.io/downloads.html
I'm using AWS Opensearch 1.3 and provider version 2.0.0.