opensearch-project / terraform-provider-opensearch

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

[BUG] Regression in AWS assumed role auth between 2.2.0 and 2.2.1 #179

Open parente opened 3 months ago

parente commented 3 months ago

What is the bug?

With the 2.2.0 opensearch provider, the following provider config ...

provider "opensearch" {
  alias                       = "dev"
  url                         = aws_opensearchserverless_collection.this.collection_endpoint
  healthcheck                 = false
  aws_assume_role_arn         = var.assumed_role
  aws_assume_role_external_id = "Terraform"
}

... allows the following resource to be provisioned and managed:

resource "opensearch_index" "vector_index" {
  name                           = var.name
  index_knn                      = true
  index_knn_algo_param_ef_search = 512
  mappings                       = <<EOF
...
EOF

When updating the provider to v2.2.1 without making any other changes, the provider errors with an EOF when attempting to create or manage the same opensearch_index resource.

How can one reproduce the bug?

  1. Plan + apply a aws_opensearchserverless_collection resource using the AWS provider. (OK)
  2. Plan + apply an index using v2.2.0 of the opensearch provider. (OK)
  3. Update the opensearch provider to v2.2.1. (OK)
  4. Plan the terraform again with no other changes. (ERROR)

What is the expected behavior?

No regression between 2.2.0 and 2.2.1.

What is your host/environment?

Terraform Cloud

Do you have any screenshots?

If applicable, add screenshots to help explain your problem.

Do you have any additional context?

TF_LOG=trace only provides a bit more info.

2024-04-11T01:58:56.723Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-04-11T01:58:56.723Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
parente commented 3 months ago

@rblcoder Thanks for the quick look and for spotting that it's an OpenSearch Serverless specific issue.

rblcoder commented 3 months ago

Thank you @parente