opensearch-project / terraform-provider-opensearch

https://registry.terraform.io/providers/opensearch-project/opensearch
Apache License 2.0
74 stars 58 forks source link

[BUG] Cannot create index with opensearch serverless collection #195

Closed sfloresk closed 3 months ago

sfloresk commented 3 months ago

What is the bug?

Cannot create index with opensearch serverless collection

How can one reproduce the bug?

provider "opensearch" {
  url = "OPENSEARCH_SERVERLESS_COLLECTION_ENDPOINT"
}

resource "opensearch_index" "test-simple-index" {
  name               = "terraform-test"
  number_of_shards   = "1"
  number_of_replicas = "1"
  mappings           = <<EOF
{
  "properties": {
    "name": {
      "type": "text"
    }
  }
}
EOF
}

On terraform apply:

╷
│ Error: EOF
│ 
│   with opensearch_index.test-simple-index,
│   on main.tf line 451, in resource "opensearch_index" "test-simple-index":
│  451: resource "opensearch_index" "test-simple-index" {
│ 
╵

What is the expected behavior?

The index to get created

What is your host/environment?

Reproduced in Mac OS and Linux environments

Do you have any screenshots?

N/A

Do you have any additional context?

The problem seems to be solved if I use the latest code (cloning the repo, building and then using TF_REATTACH_PROVIDERS env variable before "terraform apply"

It seems that this problem will be solved in the next release, do you have an estimated date on when the next release will be published?

prudhvigodithi commented 3 months ago

[Triage] Adding @rblcoder looks to me like this bug should be fixed in the upcoming release v2.2.2, can you please confirm and if so share the fixed PR here ? Thank you

rblcoder commented 3 months ago

Yes @prudhvigodithi , here is the PR https://github.com/opensearch-project/terraform-provider-opensearch/pull/180

prudhvigodithi commented 3 months ago

Thanks @rblcoder, closing this issue, @sfloresk please feel-free to re-open if required.

sfloresk commented 3 months ago

Working as expected using the 2.3.0 release. Thank you!